Changeset 1498 for trunk/dll/command.c


Ignore:
Timestamp:
Jan 18, 2010, 1:57:01 AM (16 years ago)
Author:
Gregg Young
Message:

Changes to get FM2 to compile with the latest watcom 1.9 beta (mostly type casts of CHAR CONSTANT * to CHAR *). Changes to get the environment settings working everywhere again (broken by the change that moved commands to the INI); Added an environment size variable (set to 2048 which was the largest I found hard coded). Still need to find everywhere the environment size is set and use this variable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/command.c

    r1497 r1498  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2004, 2008 Steven H. Levine
     9  Copyright (c) 2004, 2010 Steven H. Levine
    1010
    1111  01 Aug 04 SHL Rework lstrip/rstrip usage
     
    3636  27 Dec 09 GKY Added QueryCommandSettings to streamline code
    3737  27 Dec 09 GKY Made command hotkeys user selectable.
     38  17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
    3839
    3940***********************************************************************/
     
    374375
    375376  size = sizeof(BOOL) * 300;
    376   PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.UsedCommandIDs", &UsedCommandIDs,
     377  PrfQueryProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.UsedCommandIDs", &UsedCommandIDs,
    377378                      &size);
    378379  size = sizeof(BOOL) * 40;
    379   PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.UsedHotKeyIDs", &UsedHotKeyIDs,
     380  PrfQueryProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.UsedHotKeyIDs", &UsedHotKeyIDs,
    380381                        &size); size = sizeof(BOOL);
    381   PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.LoadCommandsFromINI",
     382  PrfQueryProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.LoadCommandsFromINI",
    382383                      &fLoadCommandsFromINI, &size);
    383384  if (!fLoadCommandsFromINI) {
     
    480481      cmdloaded = TRUE;
    481482      size = sizeof(ULONG);
    482       PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.SizeSortOrder",
     483      PrfQueryProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.SizeSortOrder",
    483484                          &ulSizeCommandsList, &size);
    484485      pszCommandsList = xmallocz(ulSizeCommandsList, pszSrcFile, __LINE__);
    485486      if (pszCommandsList) {
    486         PrfQueryProfileString(fmprof, FM3Str, "COMMANDS.SortOrder",
     487        PrfQueryProfileString(fmprof, (CHAR *) FM3Str, "COMMANDS.SortOrder",
    487488                              NullStr, pszCommandsList, ulSizeCommandsList);
    488489        p = pszCommandsList;
     
    501502            sprintf(key, "COMMAND.%sID", szTitle);
    502503            size = sizeof(ULONG);
    503             PrfQueryProfileData(fmprof, FM3Str, key, &ID, &size);
     504            PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &ID, &size);
    504505            sprintf(key, "COMMAND.%sHotKeyID", szTitle);
    505506            size = sizeof(ULONG);
    506             PrfQueryProfileData(fmprof, FM3Str, key, &HotKeyID, &size);
     507            PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &HotKeyID, &size);
    507508            sprintf(key, "COMMAND.%sflags", szTitle);
    508509            size = sizeof(ULONG);
    509             PrfQueryProfileData(fmprof, FM3Str, key, &flags, &size);
     510            PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &flags, &size);
    510511            sprintf(key, "COMMAND.%senv", szTitle);
    511             PrfQueryProfileString(fmprof, FM3Str, key, NullStr, env, sizeof(env));
     512            PrfQueryProfileString(fmprof, (CHAR *) FM3Str, key, NullStr, env, sizeof(env));
    512513            sprintf(key, "COMMAND.%sCmdLine", szTitle);
    513             PrfQueryProfileString(fmprof, FM3Str, key, NullStr, pszCmdLine, MaxComLineStrg);
     514            PrfQueryProfileString(fmprof, (CHAR *) FM3Str, key, NullStr, pszCmdLine, MaxComLineStrg);
    514515          }
    515516          info = xmallocz(sizeof(LINKCMDS), pszSrcFile, __LINE__);
     
    550551        sprintf(key, "COMMAND.%sID", info->title);
    551552        size = sizeof(ULONG);
    552         PrfQueryProfileData(fmprof, FM3Str, key, &ID, &size);
     553        PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &ID, &size);
    553554        sprintf(key, "COMMAND.%sHotKeyID", info->title);
    554555        size = sizeof(ULONG);
    555         PrfQueryProfileData(fmprof, FM3Str, key, &HotKeyID, &size);
     556        PrfQueryProfileData(fmprof, (CHAR *) FM3Str, key, &HotKeyID, &size);
    556557        sprintf(key, "COMMAND.%senv", info->title);
    557         PrfQueryProfileString(fmprof, FM3Str, key, NullStr, env, sizeof(env));
     558        PrfQueryProfileString(fmprof, (CHAR *) FM3Str, key, NullStr, env, sizeof(env));
    558559        if (ID != 0) {
    559560          if (env != NullStr)
     
    584585                     GetPString(IDS_COMMANDSLIMITREACHEDTEXT ));
    585586          }
    586           PrfQueryProfileString(fmprof, FM3Str, info->pszCmdLine, NullStr, env, sizeof(env));
     587          PrfQueryProfileString(fmprof, (CHAR *) FM3Str, info->pszCmdLine, NullStr, env, sizeof(env));
    587588          info->env = xstrdup(env, pszSrcFile, __LINE__);
    588589        }
     
    610611    while (info) {
    611612      sprintf(key, "COMMAND.%sflags", info->title);
    612       PrfWriteProfileData(fmprof, FM3Str, key, &info->flags, sizeof(ULONG));
     613      PrfWriteProfileData(fmprof, (CHAR *) FM3Str, key, &info->flags, sizeof(ULONG));
    613614      sprintf(key, "COMMAND.%sCmdLine", info->title);
    614       PrfWriteProfileString(fmprof, FM3Str, key, info->pszCmdLine);
     615      PrfWriteProfileString(fmprof, (CHAR *) FM3Str, key, info->pszCmdLine);
    615616      bstripcr(info->title);
    616617      sprintf(key, "COMMAND.%sID", info->title);
    617       PrfWriteProfileData(fmprof, FM3Str, key, &info->ID, sizeof(INT));
     618      PrfWriteProfileData(fmprof, (CHAR *) FM3Str, key, &info->ID, sizeof(INT));
    618619      sprintf(key, "COMMAND.%sHotKeyID", info->title);
    619       PrfWriteProfileData(fmprof, FM3Str, key, &info->HotKeyID, sizeof(INT));
     620      PrfWriteProfileData(fmprof, (CHAR *) FM3Str, key, &info->HotKeyID, sizeof(INT));
    620621      if (info->env != NullStr) {
    621622        sprintf(key, "COMMAND.%senv", info->title);
    622         PrfWriteProfileString(fmprof, FM3Str, key, info->env);
     623        PrfWriteProfileString(fmprof, (CHAR *) FM3Str, key, info->env);
    623624      }
    624625      if ((strlen(pszCommandsList) + strlen(info->title) + 1) > ulSizeCommandsList)
     
    630631      info = info->next;
    631632    } // while info
    632     PrfWriteProfileData(fmprof, FM3Str, "COMMANDS.UsedCommandIDs", &UsedCommandIDs,
     633    PrfWriteProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.UsedCommandIDs", &UsedCommandIDs,
    633634                        sizeof(BOOL) * 300);
    634     PrfWriteProfileData(fmprof, FM3Str, "COMMANDS.UsedHotKeyIDs", &UsedHotKeyIDs,
     635    PrfWriteProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.UsedHotKeyIDs", &UsedHotKeyIDs,
    635636                        sizeof(BOOL) * 40);
    636637    ulSizeCommandsList = strlen(pszCommandsList) + 1;
    637     PrfWriteProfileData(fmprof, FM3Str, "COMMANDS.SizeSortOrder",
     638    PrfWriteProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.SizeSortOrder",
    638639                        &ulSizeCommandsList, sizeof(ULONG));
    639     PrfWriteProfileString(fmprof, FM3Str, "COMMANDS.SortOrder", pszCommandsList);
    640     PrfWriteProfileData(fmprof, FM3Str, "COMMANDS.LoadCommandsFromINI",
     640    PrfWriteProfileString(fmprof, (CHAR *) FM3Str, "COMMANDS.SortOrder", pszCommandsList);
     641    PrfWriteProfileData(fmprof, (CHAR *) FM3Str, "COMMANDS.LoadCommandsFromINI",
    641642                        &fLoadCommandsFromINI, sizeof(BOOL));
    642643}
     
    747748    pszCommandsList = xmallocz(ulSizeCommandsList, pszSrcFile, __LINE__);
    748749    if (pszCommandsList)
    749       PrfQueryProfileString(fmprof, FM3Str, "COMMANDS.SortOrder",
     750      PrfQueryProfileString(fmprof, (CHAR *) FM3Str, "COMMANDS.SortOrder",
    750751                            NullStr, pszCommandsList, ulSizeCommandsList);
    751752    return 0;
     
    11021103          sprintf(keyHotKeyID, "COMMAND.%sHotKeyID", temp);
    11031104          sprintf(keyenv, "COMMAND.%senv", temp);
    1104           PrfWriteProfileData(fmprof, FM3Str, keyID, NULL, 0);
    1105           PrfWriteProfileData(fmprof, FM3Str, keyHotKeyID, NULL, 0);
    1106           PrfWriteProfileString(fmprof, FM3Str, keyenv, NULL);
     1105          PrfWriteProfileData(fmprof, (CHAR *) FM3Str, keyID, NULL, 0);
     1106          PrfWriteProfileData(fmprof, (CHAR *) FM3Str, keyHotKeyID, NULL, 0);
     1107          PrfWriteProfileString(fmprof, (CHAR *) FM3Str, keyenv, NULL);
    11071108          x = (SHORT) WinSendDlgItemMsg(hwnd,
    11081109                                        CMD_LISTBOX,
     
    11571158        sprintf(keyHotKeyID, "COMMAND.%sHotKeyID", temp->title);
    11581159        sprintf(keyenv, "COMMAND.%senv", temp->title);
    1159         PrfQueryProfileData(fmprof, FM3Str, keyID, &ID, &size);
    1160         PrfQueryProfileData(fmprof, FM3Str, keyHotKeyID, &HotKeyID, &size);
     1160        PrfQueryProfileData(fmprof, (CHAR *) FM3Str, keyID, &ID, &size);
     1161        PrfQueryProfileData(fmprof, (CHAR *) FM3Str, keyHotKeyID, &HotKeyID, &size);
    11611162        temp->ID = ID;
    11621163        if (temp->HotKeyID == HotKeyID || temp->HotKeyID == 0)
    11631164          fDontCheckHotKey = TRUE;
    11641165        if (kill_command(temp->title)) {
    1165           PrfWriteProfileData(fmprof, FM3Str, keyID, NULL, 0);
    1166           PrfWriteProfileData(fmprof, FM3Str, keyHotKeyID, NULL, 0);
    1167           PrfWriteProfileString(fmprof, FM3Str, keyenv, NULL);
     1166          PrfWriteProfileData(fmprof, (CHAR *) FM3Str, keyID, NULL, 0);
     1167          PrfWriteProfileData(fmprof, (CHAR *) FM3Str, keyHotKeyID, NULL, 0);
     1168          PrfWriteProfileString(fmprof, (CHAR *) FM3Str, keyenv, NULL);
    11681169          x = (SHORT) WinSendDlgItemMsg(hwnd,
    11691170                                        CMD_LISTBOX,
Note: See TracChangeset for help on using the changeset viewer.