Changeset 985 for trunk/dll/comp.c


Ignore:
Timestamp:
Mar 1, 2008, 2:37:14 AM (17 years ago)
Author:
Gregg Young
Message:

Update sizes dialog (ticket 44); Make max command line length user settable (ticket 199); use xfree for free in most cases (ticket 212); initial code to check for valid ini file (ticket 102); Some additional refactoring and structure rework; Some documentation updates;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/comp.c

    r959 r985  
    5151  18 Jan 08 SHL Honor filters in actions
    5252  20 Jan 08 GKY Compare dialog now saves and restores size and position
     53  29 Feb 08 GKY Use xfree where appropriate
     54  29 Feb 08 GKY Refactor global command line variables to notebook.h
    5355
    5456***********************************************************************/
     
    7678#include "comp.h"
    7779#include "fm3dll.h"
     80#include "notebook.h"                   // External compare/dircompare
    7881
    7982typedef struct
     
    140143        DosFindClose(hdir);
    141144      }
    142       free(mask);
     145      xfree(mask);
    143146    }
    144     free(pffb);
     147    xfree(pffb);
    145148  }
    146149}
     
    174177      }
    175178    }
    176     free(sf);
     179    xfree(sf);
    177180  }
    178181}
     
    678681    WinTerminate(hab);
    679682  }
    680   free(cmp);
     683  xfree(cmp);
    681684}
    682685
     
    735738    WinTerminate(hab);
    736739  }
    737   free(cmp);
     740  xfree(cmp);
    738741}
    739742
     
    780783  pciSa = xmalloc(sizeof(PCNRITEM) * numS, pszSrcFile, __LINE__);
    781784  if (!pciSa) {
    782     free(pciDa);
     785    xfree(pciDa);
    783786    return;
    784787  }
     
    813816      goto Restart;
    814817    }
    815     free(pciDa);
    816     free(pciSa);
     818    xfree(pciDa);
     819    xfree(pciSa);
    817820    Runtime_Error(pszSrcFile, __LINE__, "numD %u != x %lu", numD, x);
    818821    return;
     
    840843      goto Restart;
    841844    }
    842     free(pciSa);
    843     free(pciDa);
     845    xfree(pciSa);
     846    xfree(pciDa);
    844847    Runtime_Error(pszSrcFile, __LINE__, "numS (%lu) != x (%lu)", numS, x);
    845848    return;
     
    12841287  }
    12851288
    1286   free(pciSa);
    1287   free(pciDa);
     1289  xfree(pciSa);
     1290  xfree(pciDa);
    12881291
    12891292  if (fUpdateHideButton) {
     
    13251328  pffbArray = xmalloc(ulBufBytes, pszSrcFile, __LINE__);
    13261329  if (!pffbArray) {
    1327     free(maskstr);
     1330    xfree(maskstr);
    13281331    return;
    13291332  }
     
    13931396  }
    13941397
    1395   free(maskstr);
    1396   free(pffbArray);
     1398  xfree(maskstr);
     1399  xfree(pffbArray);
    13971400
    13981401  // DbgMsg(pszSrcFile, __LINE__, "FillDirList finish %s", str);
     
    19751978        } // if insufficient resources
    19761979
    1977         if (filesl)
    1978           free(filesl);                 // Free header - have already freed elements
     1980          xfree(filesl);                        // Free header - have already freed elements
    19791981        filesl = NULL;
    1980         if (filesr)
    1981           free(filesr);
     1982          xfree(filesr);
    19821983        filesr = NULL;
    19831984
     
    20462047    WinTerminate(hab);
    20472048  }
    2048   free(cmp);
     2049  xfree(cmp);
    20492050  DosPostEventSem(CompactSem);
    20502051
     
    26072608                        GetPString(IDS_COULDNTSTARTTHREADTEXT));
    26082609          WinDismissDlg(hwnd, 0);
    2609           free(forthread);
     2610          xfree(forthread);
    26102611        }
    26112612        else {
     
    28872888              Runtime_Error(pszSrcFile, __LINE__,
    28882889                            GetPString(IDS_COULDNTSTARTTHREADTEXT));
    2889               free(sf);
     2890              xfree(sf);
    28902891            }
    28912892          }
     
    29392940            Runtime_Error(pszSrcFile, __LINE__,
    29402941                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    2941             free(forthread);
     2942            xfree(forthread);
    29422943          }
    29432944          else {
     
    30623063            Runtime_Error(pszSrcFile, __LINE__,
    30633064                          GetPString(IDS_COULDNTSTARTTHREADTEXT));
    3064             free(forthread);
     3065            xfree(forthread);
    30653066          }
    30663067          else {
     
    32183219          WinSendMsg(cmp->dcd.hwndObject, WM_CLOSE, MPVOID, MPVOID);
    32193220      }
    3220       free(cmp);
     3221      xfree(cmp);
    32213222    }
    32223223    EmptyCnr(hwndLeft);
Note: See TracChangeset for help on using the changeset viewer.