Changeset 1673
- Timestamp:
- Dec 30, 2012, 7:51:01 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 61 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/av2.c
r1404 r1673 51 51 VOID APIENTRY deinit(ULONG why) 52 52 { 53 / * cleanup before exiting */53 // cleanup before exiting 54 54 55 55 DosCloseMutexSem(av2Sem); -
trunk/dll/cmdline.c
r1546 r1673 467 467 WinSetDlgItemText(hwnd, EXEC_WARNING2, (CHAR *) GetPString(IDS_NOTDIRECTEXETEXT)); 468 468 } 469 else if (apptype) { / * acceptable */469 else if (apptype) { // acceptable 470 470 471 471 CHAR s[257]; … … 729 729 WinQueryDlgItemText(hwnd, EXEC_CL, 1000, ex->commandline); 730 730 ex->flags = CheckExecutibleFlags(hwnd, 2); 731 /*ex->flags = 0;732 if (WinQueryButtonCheckstate(hwnd, EXEC_MINIMIZED))733 ex->flags |= MINIMIZED;734 if (WinQueryButtonCheckstate(hwnd, EXEC_MAXIMIZED))735 ex->flags |= MAXIMIZED;736 if (WinQueryButtonCheckstate(hwnd, EXEC_FULLSCREEN))737 ex->flags |= FULLSCREEN;738 else739 ex->flags |= WINDOWED;740 if (WinQueryButtonCheckstate(hwnd, EXEC_INVISIBLE))741 ex->flags |= INVISIBLE;742 if (WinQueryButtonCheckstate(hwnd, EXEC_KEEP))743 ex->flags |= SEPARATEKEEP;744 else745 ex->flags |= SEPARATE;*/746 731 strset(ex->environment, 0); 747 732 WinQueryDlgItemText(hwnd, EXEC_ENVIRON, 1000, ex->environment); -
trunk/dll/codepage.c
r1498 r1673 219 219 ULONG cps[50], len, x; 220 220 221 /*222 numcps = WinQueryCpList(WinQueryAnchorBlock(hwnd),50,cps);223 if(numcps) {224 for(x = 0;x < numcps;x++) {225 if(cps[x] == (ULONG)cp) {226 hmq = WinQueryWindowULong(hwnd,QWL_HMQ);227 WinSetCp(hmq,cp);228 break;229 }230 }231 }232 */233 221 if (cp == 1004) { 234 222 hmq = WinQueryWindowULong(hwnd, QWL_HMQ); -
trunk/dll/collect.c
r1671 r1673 228 228 } 229 229 230 / * don't have tree view in collector */230 // don't have tree view in collector 231 231 WinSendMsg(hwndButtonPopup, 232 232 MM_DELETEITEM, … … 597 597 Fortify_BecomeOwner(dcd); 598 598 # endif 599 / * set unique id */599 // set unique id 600 600 WinSetWindowUShort(hwnd, 601 601 QWS_ID, … … 696 696 } 697 697 else { 698 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, 699 "CM_QUERYCNRINFO" /* PCSZ_QUERYCNRINFO fixme */); 698 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, PCSZ_QUERYCNRINFO); 700 699 ulRecsAtStart = 0; 701 700 } … … 940 939 } 941 940 if (errs > (first ? 0 : 50)) { 942 / * prevent runaway on bad file */941 // prevent runaway on bad file 943 942 APIRET ret = saymsg(MB_YESNO, dcd->hwndCnr, 944 943 GetPString(IDS_COLLECTNOLISTHDRTEXT), … … 1245 1244 USHORT attrib = CRA_CURSORED; 1246 1245 1247 / * make found item current item */1246 // make found item current item 1248 1247 if (!stricmp(pci->pszFileName, dcd->szCommonName)) 1249 1248 attrib |= CRA_SELECTED; 1250 1249 WinSendMsg(hwnd, CM_SETRECORDEMPHASIS, MPFROMP(pci), 1251 1250 MPFROM2SHORT(TRUE, attrib)); 1252 / * make sure that record shows in viewport */1251 // make sure that record shows in viewport 1253 1252 ShowCnrRecord(hwnd, (PMINIRECORDCORE) pci); 1254 1253 return (MRESULT) TRUE; … … 1333 1332 1334 1333 case WM_SETFOCUS: 1335 /* 1336 * put name of our window on status line 1337 */ 1334 // put name of our window on status line 1338 1335 if (dcd && hwndStatus && mp2) { 1339 1336 PCNRITEM pci = NULL; … … 1503 1500 if (dcd) { 1504 1501 if (!dcd->hwndObject) { 1505 / * first time through -- set things up */1502 // first time through -- set things up 1506 1503 1507 1504 CNRINFO cnri; … … 1552 1549 AdjustCnrColsForPref(hwnd, NULL, &dcd->ds, FALSE); 1553 1550 1554 / * fix splitbar for collector container */1551 // fix splitbar for collector container 1555 1552 cnri.xVertSplitbar = DIR_SPLITBAR_OFFSET - 32; 1556 1553 size = sizeof(LONG); … … 2546 2543 // fixme to know why needed 2547 2544 pDInfo = ((PCNRDRAGINFO) mp2)->pDragInfo; 2548 DrgAccessDraginfo(pDInfo); / * Access DRAGINFO */2549 DrgFreeDraginfo(pDInfo); / * Free DRAGINFO */2545 DrgAccessDraginfo(pDInfo); // Access DRAGINFO 2546 DrgFreeDraginfo(pDInfo); // Free DRAGINFO 2550 2547 } 2551 2548 return 0; … … 2554 2551 case CN_DRAGOVER: 2555 2552 if (mp2) { 2556 PDRAGITEM pDItem; / * Pointer to DRAGITEM */2557 PDRAGINFO pDInfo; / * Pointer to DRAGINFO */2553 PDRAGITEM pDItem; // Pointer to DRAGITEM 2554 PDRAGINFO pDInfo; // Pointer to DRAGINFO 2558 2555 PCNRITEM pci; 2559 2556 USHORT uso; … … 2566 2563 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, 2567 2564 PCSZ_DRGACCESSDRAGINFO); 2568 return (MRFROM2SHORT(DOR_NODROP, 0)); / * Drop not valid */2565 return (MRFROM2SHORT(DOR_NODROP, 0)); // Drop not valid 2569 2566 } 2570 2567 if (pci) { … … 2600 2597 } 2601 2598 } 2602 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */2603 0); /* Index to DRAGITEM */2604 if (DrgVerifyRMF(pDItem, /* Check valid rendering */2605 (CHAR *) DRM_OS2FILE, /* mechanisms and data */2599 pDItem = DrgQueryDragitemPtr(pDInfo, // Access DRAGITEM 2600 0); // Index to DRAGITEM 2601 if (DrgVerifyRMF(pDItem, // Check valid rendering 2602 (CHAR *) DRM_OS2FILE, // mechanisms and data 2606 2603 NULL)) { 2607 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO */2604 DrgFreeDraginfo(pDInfo); // Free DRAGINFO 2608 2605 if (pci) { 2609 2606 if (driveflags[toupper(*pci->pszFileName) - 'A'] & … … 2612 2609 if (toupper(*pci->pszFileName) < 'C') 2613 2610 return MRFROM2SHORT(DOR_DROP, DO_COPY); 2614 return MRFROM2SHORT(DOR_DROP, /* Return okay to drop */2611 return MRFROM2SHORT(DOR_DROP, // Return okay to drop 2615 2612 ((fCopyDefault) ? DO_COPY : DO_MOVE)); 2616 2613 } 2617 2614 else 2618 return MRFROM2SHORT(DOR_DROP, /* Return okay to drop */2615 return MRFROM2SHORT(DOR_DROP, // Return okay to drop 2619 2616 DO_COPY); 2620 2617 } 2621 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO */2622 } 2623 return (MRFROM2SHORT(DOR_NODROP, 0)); /* Drop not valid */2618 DrgFreeDraginfo(pDInfo); // Free DRAGINFO 2619 } 2620 return (MRFROM2SHORT(DOR_NODROP, 0)); // Drop not valid 2624 2621 2625 2622 case CN_INITDRAG: -
trunk/dll/command.c
r1640 r1673 378 378 ULONG size; 379 379 380 381 /*size = sizeof(BOOL) * 300;382 PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.UsedCommandIDs", &UsedCommandIDs,383 &size);384 size = sizeof(BOOL) * 40;385 PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.UsedHotKeyIDs", &UsedHotKeyIDs,386 &size);*/ // No need to use profile just count them GKY 02 JUL 11387 380 size = sizeof(BOOL); 388 381 PrfQueryProfileData(fmprof, FM3Str, "COMMANDS.LoadCommandsFromINI", … … 404 397 continue; 405 398 if (!xfgets_bstripcr(pszCmdLine, MaxComLineStrg, fp, pszSrcFile, __LINE__)) 406 break; / * error! */399 break; // error! 407 400 if (!xfgets_bstripcr(flags, sizeof(flags), fp, pszSrcFile, __LINE__)) 408 401 break; … … 739 732 return NULL; 740 733 } 741 if (!cmdhead) / * only item in list */734 if (!cmdhead) // only item in list 742 735 cmdhead = cmdtail = info; 743 736 else { 744 / * place at tail */737 // place at tail 745 738 cmdtail->next = info; 746 739 info->prev = cmdtail; -
trunk/dll/comp.c
r1670 r1673 1569 1569 memset(&fb4, 0, sizeof(fb4)); 1570 1570 fp = xfopen(cmp->rightlist, moder, pszSrcFile, __LINE__, FALSE); 1571 /*if (!fp)1572 Runtime_Error(pszSrcFile, __LINE__, "can not open %s (%d)",1573 cmp->rightlist, errno);*/1574 1571 if (fp) { 1575 1572 while (!feof(fp)) { … … 2137 2134 2138 2135 if (!fEnable) { 2139 / * Disable before */2136 // Disable before 2140 2137 WinEnableWindowUpdate(hwndLeft, fEnable); 2141 2138 WinEnableWindowUpdate(hwndRight, fEnable); … … 2144 2141 WinEnableWindow(hwndRight, fEnable); 2145 2142 if (fEnable) { 2146 / * Enable after */2143 // Enable after 2147 2144 WinEnableWindowUpdate(hwndLeft, fEnable); 2148 2145 WinEnableWindowUpdate(hwndRight, fEnable); … … 2150 2147 2151 2148 WinEnableWindow(WinWindowFromID(hwnd, DID_OK), fEnable); 2152 // WinEnableWindow(WinWindowFromID(hwnd, DID_CANCEL), fEnable);2153 2149 WinEnableWindow(WinWindowFromID(hwnd, COMP_COLLECT), fEnable); 2154 2150 WinEnableWindow(WinWindowFromID(hwnd, IDM_SELECTBOTH), fEnable); … … 2248 2244 2249 2245 for (x = 0; ids[x]; x++) { 2250 //fixme to allow user to change presparams 1-10-09 GKY2251 2246 sprintf(s, "CompDir%i", ids[x]); 2252 2247 RestorePresParams(WinWindowFromID(hwnd, ids[x]), s); 2253 /*SetPresParams(WinWindowFromID(hwnd, ids[x]),2254 &RGBGREY,2255 &RGBBLACK, &RGBBLACK, FNT_8HELVETICA);*/2256 2248 } 2257 2249 } -
trunk/dll/datamin.c
r1628 r1673 417 417 break; 418 418 } 419 / * else intentional fallthru */419 // else intentional fallthru 420 420 case WM_CHORD: 421 421 case WM_BUTTON3DBLCLK: … … 1084 1084 pDM->qfsa_cb = sizeof(FSQBUFFER2) + 256; // se tDataMin 1085 1085 DosError(FERR_DISABLEHARDERR); 1086 pDM->qfsa_rc = DosQueryFSAttach(szPath, 0, / * Ordinal */1086 pDM->qfsa_rc = DosQueryFSAttach(szPath, 0, // Ordinal 1087 1087 FSAIL_QUERYNAME, 1088 1088 &pDM->fsqb2, &pDM->qfsa_cb); -
trunk/dll/defview.c
r1656 r1673 203 203 ULONG flags, CHAR * filename) 204 204 { 205 /* 205 /** 206 206 * bitmapped flags: 207 207 * --------------- … … 228 228 } 229 229 230 if (flags & 1) / * directly view the file */230 if (flags & 1) // directly view the file 231 231 goto ViewIt; 232 232 233 if (flags & 2) { / * open default WPS view of file */233 if (flags & 2) { // open default WPS view of file 234 234 OpenObject(filename, Default, hwnd); 235 235 return; 236 236 } 237 237 238 if (flags & 4) { / * open WPS settings notebook for file */238 if (flags & 4) { // open WPS settings notebook for file 239 239 OpenObject(filename, Settings, hwnd); 240 240 return; 241 241 } 242 242 243 if ((flags & 16) || !IsFile(filename)) { / * open info for directories */243 if ((flags & 16) || !IsFile(filename)) { // open info for directories 244 244 245 245 char fullname[CCHMAXPATH]; … … 267 267 } 268 268 269 if (flags & 8) { / * edit file */269 if (flags & 8) { // edit file 270 270 271 271 ULONG type = IDM_EDITTEXT; … … 282 282 break; 283 283 } 284 / * else intentional fallthru */284 // else intentional fallthru 285 285 case IDM_EDITTEXT: 286 286 if (*editor) -
trunk/dll/dircnrs.c
r1664 r1673 225 225 break; 226 226 } 227 / * else intentional fallthru */227 // else intentional fallthru 228 228 case DIR_SELECTED: 229 229 case DIR_VIEW: … … 256 256 QW_PARENT), 257 257 DIR_CNR), QWL_USER); 258 if (id == DIR_SORT) { / * don't have sort pathname in dirs */258 if (id == DIR_SORT) { // don't have sort pathname in dirs 259 259 WinSendMsg(hwndButtonPopup, 260 260 MM_DELETEITEM, … … 514 514 if (AcceptOneDrop(hwnd, mp1, mp2)) 515 515 return MRFROM2SHORT(DOR_DROP, DO_MOVE); 516 return (MRFROM2SHORT(DOR_NODROP, 0)); / * Drop not valid */516 return (MRFROM2SHORT(DOR_NODROP, 0)); // Drop not valid 517 517 case DM_DROPHELP: 518 518 DropHelp(mp1, mp2, hwnd, GetPString(IDS_DIRCNRFOLDERDROPHELP)); … … 754 754 Fortify_ChangeScope(dcd, -1); 755 755 # endif 756 / * set unique id */756 // set unique id 757 757 WinSetWindowUShort(hwnd, QWS_ID, DIROBJ_FRAME + (DIR_FRAME - dcd->id)); 758 758 dcd->hwndObject = hwnd; 759 759 if (ParentIsDesktop(hwnd, dcd->hwndParent)) 760 DosSleep(100); //05 Aug 07 GKY 250760 DosSleep(100); 761 761 } 762 762 else … … 835 835 836 836 case UM_RESCAN: 837 /* 838 * populate container 839 */ 837 // populate container 840 838 dcd = WinQueryWindowPtr(hwnd, QWL_USER); 841 839 if (dcd) { 842 //DosEnterCritSec(); //GKY 11-29-08843 840 DosRequestMutexSem(hmtxFM2Globals, SEM_INDEFINITE_WAIT); 844 841 if (dcd->stopflag) … … 846 843 if (dcd->stopflag) { 847 844 DosReleaseMutexSem(hmtxFM2Globals); 848 //DosExitCritSec();849 845 return 0; 850 846 } 851 847 DosReleaseMutexSem(hmtxFM2Globals); 852 //DosExitCritSec();853 848 if (mp1) { 854 849 strcpy(dcd->previous, dcd->directory); … … 943 938 WinSendMsg(dcd->hwndCnr, CM_SETRECORDEMPHASIS, MPFROMP(pci), 944 939 MPFROM2SHORT(TRUE, CRA_CURSORED)); 945 / * make sure that record shows in viewport */940 // make sure that record shows in viewport 946 941 ShowCnrRecord(dcd->hwndCnr, (PMINIRECORDCORE) pci); 947 942 } … … 1362 1357 1363 1358 case WM_SETFOCUS: 1364 / * put name of our window (directory name) on status line */1359 // put name of our window (directory name) on status line 1365 1360 if (mp2) { 1366 1361 // Getting focus 1367 1362 if (dcd && hwndStatus) { 1368 / * put name of our window (directory name) on status line */1363 // put name of our window (directory name) on status line 1369 1364 PCNRITEM pci = NULL; 1370 1365 if (fAutoView && hwndMain) { … … 1550 1545 if (dcd) { 1551 1546 if (!dcd->hwndObject) { 1552 /* 1553 * first time through -- set things up 1554 */ 1547 // first time through -- set things up 1555 1548 1556 1549 CNRINFO cnri; … … 1881 1874 pci = FindCnrRecord(hwnd, newfile, NULL, TRUE, FALSE, TRUE); 1882 1875 if (pci && (INT) pci != -1) 1883 / * make sure that record shows in viewport */1876 // make sure that record shows in viewport 1884 1877 ShowCnrRecord(hwnd, (PMINIRECORDCORE) pci); 1885 1878 } … … 2840 2833 break; 2841 2834 2842 /*2843 case CN_PICKUP:2844 return PickUp(hwnd,dcd->hwndObject,mp2);2845 */2846 2847 2835 case CN_CONTEXTMENU: 2848 2836 { … … 2933 2921 if (mp2) { 2934 2922 2935 PDRAGITEM pDItem; / * Pointer to DRAGITEM */2936 PDRAGINFO pDInfo; / * Pointer to DRAGINFO */2923 PDRAGITEM pDItem; // Pointer to DRAGITEM 2924 PDRAGINFO pDInfo; // Pointer to DRAGINFO 2937 2925 PCNRITEM pci; 2938 2926 USHORT uso; … … 2949 2937 DRIVE_NOTWRITEABLE)) { 2950 2938 DrgFreeDraginfo(pDInfo); 2951 return MRFROM2SHORT(DOR_DROP, / * Return okay to link */2952 DO_LINK); / * (compare) only */2939 return MRFROM2SHORT(DOR_DROP, // Return okay to link 2940 DO_LINK); // (compare) only 2953 2941 } 2954 2942 if (pci) { … … 2986 2974 } 2987 2975 2988 /* Access DRAGITEM index to DRAGITEM 2976 /** 2977 * Access DRAGITEM index to DRAGITEM 2989 2978 * Check valid rendering mechanisms and data 2990 2979 */ … … 2999 2988 if (toupper(*dcd->directory) < 'C') 3000 2989 return MRFROM2SHORT(DOR_DROP, DO_COPY); 3001 return MRFROM2SHORT(DOR_DROP, / * Return okay to drop */2990 return MRFROM2SHORT(DOR_DROP, // Return okay to drop 3002 2991 ((fCopyDefault) ? DO_COPY : DO_MOVE)); 3003 2992 } 3004 DrgFreeDraginfo(pDInfo); / * Free DRAGINFO */3005 } 3006 return MRFROM2SHORT(DOR_NODROP, 0); / * Drop not valid */2993 DrgFreeDraginfo(pDInfo); // Free DRAGINFO 2994 } 2995 return MRFROM2SHORT(DOR_NODROP, 0); // Drop not valid 3007 2996 3008 2997 case CN_INITDRAG: … … 3634 3623 MPFROMLONG(CMA_FIRST)); 3635 3624 if (pci && (INT) pci != -1) { 3636 / * Got match make found item current item */3625 // Got match make found item current item 3637 3626 USHORT attrib = CRA_CURSORED; 3638 3627 // 29 Mar 09 SHL fixme to clear other object select if not extended select … … 3641 3630 WinSendMsg(hwnd, CM_SETRECORDEMPHASIS, MPFROMP(pci), 3642 3631 MPFROM2SHORT(TRUE, attrib)); 3643 / * make sure that record shows in viewport */3632 // make sure that record shows in viewport 3644 3633 ShowCnrRecord(hwnd, (PMINIRECORDCORE) pci); 3645 3634 return (MRESULT)TRUE; … … 3675 3664 ULONG flags) 3676 3665 { 3677 /* bitmapped flags: 3666 /** 3667 * bitmapped flags: 3678 3668 * 0x00000001 = don't close app when window closes 3679 3669 * 0x00000002 = no frame controls -
trunk/dll/dirs.c
r1607 r1673 53 53 *curdir = 0; 54 54 ret = DosQCurDisk(&curdrive, &drivemap); 55 curdirlen = CCHMAXPATH - 4; / * NOTE!!!!!!!!! */55 curdirlen = CCHMAXPATH - 4; // NOTE!!!!!!!!! 56 56 ret += DosQCurDir(curdrive, (PBYTE)&curdir[3], &curdirlen); 57 57 *curdir = (CHAR) ('@' + (INT) curdrive); -
trunk/dll/dirsize.c
r1570 r1673 182 182 DosFindClose(hdir); 183 183 184 /* 184 /** 185 185 * the "|| strlen(pszFileName) < 4 below works around an OS/2 bug 186 186 * that prevents FAT root directories from being found when -
trunk/dll/droplist.c
r1498 r1673 52 52 BOOL CheckPmDrgLimit(PDRAGINFO pDInfo) 53 53 { 54 /* 54 /** 55 55 * Checks for FM2 source window then checks window words 56 56 * for ulItemsToUnHilite and if it is not zero displays a … … 79 79 char *buffer2, ULONG buflen2) 80 80 { 81 /* 81 /** 82 82 * Gets archive name from directory field, file name from file field 83 83 * Returns FALSE on error, TRUE on success. … … 87 87 BOOL ret = FALSE; 88 88 89 if (pDItem && buffer2 && buflen2) { / * else error calling function */90 if (buffer1 && buflen1) / * zero buffers */89 if (pDItem && buffer2 && buflen2) { // else error calling function 90 if (buffer1 && buflen1) // zero buffers 91 91 *buffer1 = 0; 92 92 *buffer2 = 0; … … 95 95 len = DrgQueryStrName(pDItem->hstrContainerName, buflen1, buffer1); 96 96 buffer1[len] = 0; 97 if (len) { / * be sure we get full pathname of arc file */97 if (len) { // be sure we get full pathname of arc file 98 98 99 99 char szTemp[CCHMAXPATH + 2]; … … 105 105 } 106 106 } 107 { / * be sure that file/directory is accessible */107 { // be sure that file/directory is accessible 108 108 FILESTATUS3 fsa3; 109 109 … … 130 130 BOOL FullDrgName(PDRAGITEM pDItem, CHAR * buffer, ULONG buflen) 131 131 { 132 /* 132 /** 133 133 * Gets full name of file from a dragged item. 134 134 * Returns FALSE on error, TRUE on success. … … 140 140 FILESTATUS3 fsa3; 141 141 142 if (pDItem && buffer && buflen) { / * else error calling function */143 *buffer = 0; / * zero buffer */142 if (pDItem && buffer && buflen) { // else error calling function 143 *buffer = 0; // zero buffer 144 144 145 145 blen = DrgQueryStrName(pDItem->hstrContainerName, buflen, buffer); … … 157 157 buflen - blen, buffer + blen); 158 158 buffer[blen + len] = 0; 159 { / * be sure we get full pathname of file/directory */159 { // be sure we get full pathname of file/directory 160 160 char szTemp[CCHMAXPATH + 2]; 161 161 rc = DosQueryPathInfo(buffer, … … 184 184 BOOL GetOneDrop(HWND hwnd, MPARAM mp1, MPARAM mp2, char *buffer, ULONG buflen) 185 185 { 186 PDRAGITEM pDItem; / * DRAGITEM struct ptr */187 PDRAGINFO pDInfo; / * DRAGINFO struct ptr */186 PDRAGITEM pDItem; // DRAGITEM struct ptr 187 PDRAGINFO pDInfo; // DRAGINFO struct ptr 188 188 ULONG numitems; 189 189 register ULONG curitem; … … 191 191 192 192 if (buffer && buflen) 193 *buffer = 0; / * zero buffer field */194 195 pDInfo = (PDRAGINFO) mp1; / * Get DRAGINFO pointer */193 *buffer = 0; // zero buffer field 194 195 pDInfo = (PDRAGINFO) mp1; // Get DRAGINFO pointer 196 196 if (pDInfo) { 197 197 if (!DrgAccessDraginfo(pDInfo)) { … … 203 203 pDItem = DrgQueryDragitemPtr(pDInfo,0); 204 204 if (buflen && buffer) { 205 if (DrgVerifyRMF(pDItem, /* Check valid rendering */206 (CHAR *) DRM_OS2FILE, / * mechanisms and data */205 if (DrgVerifyRMF(pDItem, // Check valid rendering 206 (CHAR *) DRM_OS2FILE, // mechanisms and data 207 207 NULL) && !(pDItem->fsControl & DC_PREPARE)) 208 208 ret = FullDrgName(pDItem, buffer, buflen); … … 224 224 BOOL AcceptOneDrop(HWND hwnd, MPARAM mp1, MPARAM mp2) 225 225 { 226 PDRAGITEM pDItem; / * Pointer to DRAGITEM */227 PDRAGINFO pDInfo; / * Pointer to DRAGINFO */226 PDRAGITEM pDItem; // Pointer to DRAGITEM 227 PDRAGINFO pDInfo; // Pointer to DRAGINFO 228 228 BOOL ret = FALSE; 229 229 230 pDInfo = (PDRAGINFO) mp1; / * Get DRAGINFO pointer */230 pDInfo = (PDRAGINFO) mp1; // Get DRAGINFO pointer 231 231 if (pDInfo) { 232 232 if (!DrgAccessDraginfo(pDInfo)) { … … 237 237 pDItem = DrgQueryDragitemPtr(pDInfo, 0); 238 238 239 / * Check valid rendering mechanisms and data formats */239 // Check valid rendering mechanisms and data formats 240 240 if (DrgVerifyRMF(pDItem, (CHAR *) DRM_OS2FILE, NULL)) 241 241 ret = TRUE; … … 279 279 MPARAM mp1, MPARAM mp2) 280 280 { 281 / * builds a list from the dropped files */281 // builds a list from the dropped files 282 282 283 283 BOOL isArc = FALSE, arctest = FALSE; … … 335 335 } 336 336 337 / * ambiguous drop request -- see what's allowed */337 // ambiguous drop request -- see what's allowed 338 338 if (Operation == DO_DEFAULT || Operation >= DO_UNKNOWN) { 339 339 if (pDItem->fsSupportedOps & DO_COPYABLE) … … 345 345 } 346 346 else { 347 / * ignore object if selected command not allowed for it */347 // ignore object if selected command not allowed for it 348 348 BOOL ok; 349 349 switch (Operation) { -
trunk/dll/eas.c
r1628 r1673 87 87 HOLDFEA *CheckEA(HOLDFEA * head, CHAR * eaname) 88 88 { 89 / * return pointer to ea named eaname if found in linked list */89 // return pointer to ea named eaname if found in linked list 90 90 91 91 register HOLDFEA *info = NULL; … … 196 196 } 197 197 } 198 / * if we get here, create dummy ea */198 // if we get here, create dummy ea 199 199 { 200 200 PFEA2LIST pfealist = NULL; … … 215 215 eaval += sizeof(USHORT); 216 216 if (type == EAT_MVST || type == EAT_MVMT) { 217 *(USHORT *) eaval = (USHORT) 0; / * codepage */217 *(USHORT *) eaval = (USHORT) 0; // codepage 218 218 eaval += sizeof(USHORT); 219 *(USHORT *) eaval = (USHORT) 1; / * number */219 *(USHORT *) eaval = (USHORT) 1; // number 220 220 eaval += sizeof(USHORT); 221 *(USHORT *) eaval = (USHORT) EAT_ASCII; / * type */221 *(USHORT *) eaval = (USHORT) EAT_ASCII; // type 222 222 eaval += sizeof(USHORT); 223 223 } … … 263 263 VOID HexDump(HWND hwnd, CHAR * value, ULONG cbValue) 264 264 { 265 / * display a hexdump of a binary 'string' in listbox hwnd */265 // display a hexdump of a binary 'string' in listbox hwnd 266 266 267 267 CHAR s[132]; … … 1059 1059 BOOL silentfail) 1060 1060 { 1061 / * save an ea to disk */1061 // save an ea to disk 1062 1062 1063 1063 PFEA2LIST pfealist = NULL; … … 1154 1154 } 1155 1155 break; 1156 /* 1157 1158 1156 /** 1157 * cbList nextoffset fea cb cbval name....... 1158 * 000000 3C 00 00 00 00 00 00 00 6F 0B 24 00 2E 4B 45 59 < o 1159 1159 $ .KEY 1160 1161 1162 1163 1160 * .................... eat code num eat 1161 * 000010 50 48 52 41 53 45 53 00 DF FF 00 00 02 00 FD FF PHRASES ßÿ ýÿ 1162 * len.. phrase1............................ eat 1163 * 000020 0C 00 4B 65 79 20 70 68 72 61 73 65 20 31 FD FF 1164 1164 Key phrase 1ýÿ 1165 1166 1165 * len.. phrase2...................... 1166 * 000030 0A 00 4B 65 79 20 70 68 72 61 73 65 Key phrase 1167 1167 */ 1168 1168 case EAT_MVMT: … … 1201 1201 break; 1202 1202 } 1203 pfealist->list[0].cbValue = /*(ULONG)*/ (eaval - 1204 (pfealist->list[0].szName + 1205 pfealist->list[0].cbName + 1)); 1203 pfealist->list[0].cbValue = eaval - (pfealist->list[0].szName + pfealist->list[0].cbName + 1); 1206 1204 eaop.fpGEA2List = (PGEA2LIST) 0; 1207 1205 eaop.fpFEA2List = pfealist; … … 1239 1237 HOLDFEA *GetFileEAs(CHAR * filename, BOOL ishandle, BOOL silentfail) 1240 1238 { 1241 / * load eas from disk into HOLDFEA linked list */1239 // load eas from disk into HOLDFEA linked list 1242 1240 1243 1241 HOLDFEA *head = NULL, *info, *last = NULL; … … 1342 1340 } 1343 1341 else { 1344 / * try it without opening it */1342 // try it without opening it 1345 1343 if (!DosQueryPathInfo(filename, FIL_QUERYEASIZE, (PVOID) & fsa4, 1346 1344 (ULONG) sizeof(fsa4)) && … … 1441 1439 VOID Free_FEAList(HOLDFEA * pFEA) 1442 1440 { 1443 / * free a linked list of HOLDFEAs */1441 // free a linked list of HOLDFEAs 1444 1442 1445 1443 register HOLDFEA *next; 1446 1444 1447 1445 while (pFEA) { 1448 / * Free linked list */1446 // Free linked list 1449 1447 next = pFEA->next; 1450 1448 xfree(pFEA->pfea, pszSrcFile, __LINE__); -
trunk/dll/errutil.c
r1558 r1673 216 216 PCSZ pszFmt, va_list pva) 217 217 { 218 PERRINFO pErrInfoBlk; /* Pointer to ERRINFO structure filled 219 by WinGetErrorInfo */ 220 PSZ pszOffset; /* Pointer to current error message returned 221 by WinGetErrorInfo */ 218 PERRINFO pErrInfoBlk; // Pointer to ERRINFO structure filled by WinGetErrorInfo 219 PSZ pszOffset; // Pointer to current error message returned by WinGetErrorInfo 222 220 PSZ psz; 223 221 HAB hab; … … 256 254 if (!hwndOwner) 257 255 hwndOwner = HWND_DESKTOP; 258 /* Find message offset in array of message offsets 259 Assume 1 message - fixme? 260 */ 256 // Find message offset in array of message offsets Assume 1 message - fixme? 261 257 pszOffset = ((PSZ) pErrInfoBlk) + pErrInfoBlk->offaoffszMsg; 262 /* Address error message in array of messages and 263 append error message to source code linenumber 264 */ 258 // Address error message in array of messages and append error message to source code linenumber 265 259 psz = pszBuf + strlen(pszBuf); 266 260 sprintf(psz, " #0x%04x \"", ERRORIDERROR(pErrInfoBlk->idError)); -
trunk/dll/excputil.c
r1544 r1673 1 2 /* excputil.c - exception handlers 3 $Id$ 1 /*********************************************************** 2 3 $Id$ 4 5 exception handlers 4 6 5 7 Copyright (c) 2008 Steven H. Levine … … 10 12 06 Dec 08 SHL Baseline (Ticket #26) 11 13 12 * /14 ************************************************************/ 13 15 14 16 #include <stdio.h> // fprintf -
trunk/dll/filldir.c
r1672 r1673 531 531 pci->hwndCnr = hwndCnr; 532 532 533 /* note that we cheat below, and accept the full pathname in pszDirectory 534 if !*pffb->achName. This speeds up and simplifies processing elsewhere 535 (like in update.c) 533 /** 534 * note that we cheat below, and accept the full pathname in pszDirectory 535 * if !*pffb->achName. This speeds up and simplifies processing elsewhere 536 * (like in update.c) 536 537 */ 538 537 539 if (!*pffb->achName) { 538 540 pci->pszFileName = xstrdup(pszDirectory, pszSrcFile, __LINE__); … … 878 880 PULONGLONG pullTotalBytes) // Optional 879 881 { 880 /* put all the directories (and files if filestoo is TRUE) from a 882 /** 883 * put all the directories (and files if filestoo is TRUE) from a 881 884 * directory into the container. recurse through subdirectories if 882 885 * recurse is TRUE. … … 947 950 InitITimer(&itdSleep, 500); 948 951 do { 949 /* 952 /** 950 953 * remove . and .. from list if present 951 954 * also counter file system bugs that sometimes … … 1051 1054 } 1052 1055 cAffbTotal += ulSelCnt; 1053 // 15 Sep 09 SHL allow timed updates to see1054 /*if (dcd) {1055 dcd->totalfiles += ulSelCnt;1056 dcd->ullTotalBytes += ullTotalBytes;1057 } */ //30 May 11 GKY caused counter to increment twice1058 1056 } 1059 1057 else { -
trunk/dll/findrec.c
r1550 r1673 56 56 srch.fsPrefix = FALSE; 57 57 srch.fsCaseSensitive = FALSE; 58 srch.usView = CV_TREE; /* | CV_EXACTMATCH; */58 srch.usView = CV_TREE; 59 59 if (!pciParent) 60 60 pciParent = (PCNRITEM) CMA_FIRST; … … 63 63 while (pci && (INT) pci != -1) { 64 64 if (!noenv || (pci->flags & (RECFLAGS_ENV | RECFLAGS_UNDERENV)) == 0) { 65 if (!partmatch) { / * full name must match full name */65 if (!partmatch) { // full name must match full name 66 66 if (!stricmp(pci->pszFileName, filename)) 67 return pci; / * success */67 return pci; // success 68 68 } 69 else { / * only root name must match */69 else { // only root name must match 70 70 if (strlen(pci->pszFileName) > 3) { 71 71 p = strrchr(pci->pszFileName, '\\'); … … 83 83 p = pci->pszFileName; 84 84 if (!stricmp(p, file)) 85 return pci; / * success */85 return pci; // success 86 86 } 87 87 } … … 89 89 } 90 90 91 return NULL; / * failure */91 return NULL; // failure 92 92 } 93 93 -
trunk/dll/fonts.c
r1626 r1673 34 34 35 35 36 /* 36 /** 37 37 * Convert vector font size using point size and fAttrs structure and 38 38 * return it in that structure. … … 48 48 SIZEF sizef; 49 49 50 hps = WinGetScreenPS(HWND_DESKTOP); / * Screen presentation space */51 52 /* 50 hps = WinGetScreenPS(HWND_DESKTOP); // Screen presentation space 51 52 /** 53 53 * Query device context for the screen and then query 54 54 * the resolution of the device for the device context. … … 59 59 DevQueryCaps(hDC, CAPS_VERTICAL_FONT_RES, (LONG) 1, &lyFontResolution); 60 60 61 /* 61 /** 62 62 * Calculate the size of the character box, based on the 63 63 * point size selected and the resolution of the device. … … 73 73 WinReleasePS(hps); 74 74 75 } / * end ConvertVectorPointSize() */75 } // end ConvertVectorPointSize() 76 76 77 77 VOID SetPresParamFromFattrs(HWND hwnd, FATTRS * fattrs, … … 120 120 HPS hps; 121 121 FONTMETRICS fm; 122 CHAR szFamily[CCHMAXPATH], 123 *szTitle = GetPString(IDS_SETFONTTITLETEXT), *szPreview; 124 125 //DosEnterCritSec(); //GKY 11-30-08 122 CHAR szFamily[CCHMAXPATH], *szTitle = GetPString(IDS_SETFONTTITLETEXT), *szPreview; 123 126 124 DosRequestMutexSem(hmtxFM2Globals, SEM_INDEFINITE_WAIT); 127 125 szPreview = GetPString(IDS_BLURB1TEXT + counter++); … … 131 129 } 132 130 DosReleaseMutexSem(hmtxFM2Globals); 133 //DosExitCritSec(); 134 memset(&fontdlg, 0, sizeof(fontdlg)); /* initialize all fields */ 131 memset(&fontdlg, 0, sizeof(fontdlg)); // initialize all fields 135 132 hps = WinGetPS(hwnd); 136 133 GpiQueryFontMetrics(hps, sizeof(FONTMETRICS), &fm); … … 168 165 { 169 166 170 /* Flags: 167 /** 168 * Flags: 171 169 * 172 170 * 1 = Don't assume MLE (no MLM_* messages, use fattrs only … … 183 181 CHAR szFamily[CCHMAXPATH]; 184 182 PCSZ pcszPreview; 185 static FIXED fxPointSize = 0; / * keep track of this for vector fonts */183 static FIXED fxPointSize = 0; // keep track of this for vector fonts 186 184 187 185 if ((flags & 1) && !fattrs) 188 186 return fattrs; 189 //DosEnterCritSec(); //GKY 11-30-08190 187 DosRequestMutexSem(hmtxFM2Globals, SEM_INDEFINITE_WAIT); 191 188 // 12 Jan 09 SHL fixme to do multiple previews or rename to IDS_BLURBTEXT 192 189 pcszPreview = GetPString(IDS_BLURB1TEXT); 193 190 DosReleaseMutexSem(hmtxFM2Globals); 194 memset(&fontDlg, 0, sizeof(fontDlg)); /* initialize all fields */ 195 /* 196 * Get the current font attributes 197 */ 191 memset(&fontDlg, 0, sizeof(fontDlg)); // initialize all fields 192 // Get the current font attributes 198 193 hps = WinGetPS(hwndMLE); 199 194 if (!(flags & 1)) … … 203 198 memcpy(&fontDlg.fAttrs, fattrs, sizeof(FATTRS)); 204 199 205 /* create system default font */ 206 200 // create system default font 207 201 GpiCreateLogFont(hps, (PSTR8) fontDlg.fAttrs.szFacename, 1, 208 202 &(fontDlg.fAttrs)); … … 213 207 WinReleasePS(hps); 214 208 215 /* 216 * Initialize the FONTDLG structure with the current font 217 */ 218 fontDlg.cbSize = sizeof(FONTDLG); /* sizeof(FONTDLG) */ 219 fontDlg.hpsScreen = WinGetScreenPS(HWND_DESKTOP); /* Screen presentation space */ 220 fontDlg.hpsPrinter = NULLHANDLE; /* Printer presentation space */ 209 // Initialize the FONTDLG structure with the current font 210 fontDlg.cbSize = sizeof(FONTDLG); 211 fontDlg.hpsScreen = WinGetScreenPS(HWND_DESKTOP); // Screen presentation space 212 fontDlg.hpsPrinter = NULLHANDLE; // Printer presentation space 221 213 222 214 fontDlg.pszTitle = (PSZ)GetPString(IDS_SETVIEWERFONTTITLETEXT); 223 215 fontDlg.pszPreview = (PSZ)pcszPreview; 224 fontDlg.pszPtSizeList = NULL; /* Application provided size list */225 fontDlg.pfnDlgProc = NULL; /* Dialog subclass procedure */226 strcpy(szFamily, fontMetrics.szFamilyname); /* Family name of font */227 fontDlg.pszFamilyname = szFamily; /* point to Family name of font */228 fontDlg.fxPointSize = fxPointSize; /* Point size the user selected */229 fontDlg.fl = FNTS_CENTER | /* FNTS_* flags - dialog styles */216 fontDlg.pszPtSizeList = NULL; // Application provided size list 217 fontDlg.pfnDlgProc = NULL; // Dialog subclass procedure 218 strcpy(szFamily, fontMetrics.szFamilyname); // Family name of font 219 fontDlg.pszFamilyname = szFamily; // point to Family name of font 220 fontDlg.fxPointSize = fxPointSize; // Point size the user selected 221 fontDlg.fl = FNTS_CENTER | // FNTS_* flags - dialog styles 230 222 FNTS_INITFROMFATTRS; 231 223 if (flags & 2) … … 237 229 else if (flags & 16) 238 230 fontDlg.fl |= FNTS_VECTORONLY; 239 fontDlg.flFlags = 0; / * FNTF_* state flags */240 / * Font type option bits */231 fontDlg.flFlags = 0; // FNTF_* state flags 232 // Font type option bits 241 233 fontDlg.flType = (LONG) fontMetrics.fsType; 242 fontDlg.flTypeMask = 0; / * Mask of which font types to use */243 fontDlg.flStyle = 0; / * The selected style bits */244 fontDlg.flStyleMask = 0; / * Mask of which style bits to use */245 fontDlg.clrFore = CLR_NEUTRAL; / * Selected foreground color */246 fontDlg.clrBack = CLR_BACKGROUND; / * Selected background color */247 fontDlg.ulUser = 0; / * Blank field for application */248 fontDlg.lReturn = 0; / * Return Value of the Dialog */249 fontDlg.lEmHeight = 0; / * Em height of the current font */250 fontDlg.lXHeight = 0; / * X height of the current font */251 fontDlg.lExternalLeading = 0; / * External Leading of font */252 / * Nominal Point Size of font */234 fontDlg.flTypeMask = 0; // Mask of which font types to use 235 fontDlg.flStyle = 0; // The selected style bits 236 fontDlg.flStyleMask = 0; // Mask of which style bits to use 237 fontDlg.clrFore = CLR_NEUTRAL; // Selected foreground color 238 fontDlg.clrBack = CLR_BACKGROUND; // Selected background color 239 fontDlg.ulUser = 0; // Blank field for application 240 fontDlg.lReturn = 0; // Return Value of the Dialog 241 fontDlg.lEmHeight = 0; // Em height of the current font 242 fontDlg.lXHeight = 0; // X height of the current font 243 fontDlg.lExternalLeading = 0; // External Leading of font 244 // Nominal Point Size of font 253 245 fontDlg.sNominalPointSize = fontMetrics.sNominalPointSize; 254 fontDlg.usWeight = fontMetrics.usWeightClass; /* The boldness of the font */ 255 fontDlg.usWidth = fontMetrics.usWidthClass; /* The width of the font */ 256 fontDlg.x = 0; /* X coordinate of the dialog */ 257 fontDlg.y = 0; /* Y coordinate of the dialog */ 258 // fontDlg.usDlgId = IDD_FONT; /* ID of a custom dialog template */ 259 fontDlg.usFamilyBufLen = sizeof(szFamily); /*Length of family name buffer */ 260 261 /* 262 * Bring up the standard Font Dialog 263 */ 246 fontDlg.usWeight = fontMetrics.usWeightClass; // The boldness of the font 247 fontDlg.usWidth = fontMetrics.usWidthClass; // The width of the font 248 fontDlg.x = 0; // X coordinate of the dialog 249 fontDlg.y = 0; // Y coordinate of the dialog 250 fontDlg.usFamilyBufLen = sizeof(szFamily); // Length of family name buffer 251 252 // Bring up the standard Font Dialog 264 253 265 254 if (!WinFontDlg(HWND_DESKTOP, hwndMLE, &fontDlg) … … 268 257 return NULL; 269 258 } 270 fxPointSize = fontDlg.fxPointSize; / * save point size for next dialog */271 272 /* 259 fxPointSize = fontDlg.fxPointSize; // save point size for next dialog 260 261 /** 273 262 * If outline font, calculate the maxbaselineext and 274 263 * avecharwidth for the point size selected … … 285 274 return fattrs; 286 275 287 } / * End of SetMLEFont() */276 } // End of SetMLEFont() 288 277 289 278 #pragma alloc_text(FONTS,ConvertVectorFontSize,SetFont,SetMLEFont) -
trunk/dll/fortify.c
r1544 r1673 1 2 /* $Id$ */ 3 /* fortify.cxx - A fortified memory allocation shell - V2.2 */ 4 /* vim: tabs 4 */ 5 6 /* 7 * This software is not public domain. All material in 8 * this archive is (C) Copyright 1995 Simon P. Bullen. The 9 * software is freely distributable, with the condition that 10 * no more than a nominal fee is charged for media. 11 * Everything in this distribution must be kept together, in 12 * original, unmodified form. 13 * The software may be modified for your own personal use, 14 * but modified files may not be distributed. 15 * The material is provided "as is" without warranty of 16 * any kind. The author accepts no responsibility for damage 17 * caused by this software. 18 * This software may not be used in any way by Microsoft 19 * Corporation or its subsidiaries, or current employees of 20 * Microsoft Corporation or its subsidiaries. 21 * This software may not be used for the construction, 22 * development, production, or testing of weapon systems of 23 * any kind. 24 * This software may not be used for the construction, 25 * development, production, or use of plants/installations 26 * which include the processing of radioactive/fissionable 27 * material. 28 */ 29 30 /* 31 * If you use this software at all, I'd love to hear from 32 * you. All questions, criticisms, suggestions, praise and 33 * postcards are most welcome. 34 * 35 * email: sbullen@cybergraphic.com.au 36 * 37 * snail: Simon P. Bullen 38 * PO BOX 12138 39 * A'Beckett St. 40 * Melbourne 3000 41 * Australia 42 */ 43 44 /* 06 May 08 SHL Rework scope logic to be MT capable 1 /**************************************************************** 2 3 $Id$ 4 5 fortify.cxx - A fortified memory allocation shell - V2.2 6 vim: tabs 4 7 8 9 This software is not public domain. All material in 10 this archive is (C) Copyright 1995 Simon P. Bullen. The 11 software is freely distributable, with the condition that 12 no more than a nominal fee is charged for media. 13 Everything in this distribution must be kept together, in 14 original, unmodified form. 15 The software may be modified for your own personal use, 16 but modified files may not be distributed. 17 The material is provided "as is" without warranty of 18 any kind. The author accepts no responsibility for damage 19 caused by this software. 20 This software may not be used in any way by Microsoft 21 Corporation or its subsidiaries, or current employees of 22 Microsoft Corporation or its subsidiaries. 23 This software may not be used for the construction, 24 development, production, or testing of weapon systems of 25 any kind. 26 This software may not be used for the construction, 27 development, production, or use of plants/installations 28 which include the processing of radioactive/fissionable 29 material. 30 31 32 33 If you use this software at all, I'd love to hear from 34 you. All questions, criticisms, suggestions, praise and 35 postcards are most welcome. 36 37 email: sbullen@cybergraphic.com.au 38 39 snail: Simon P. Bullen 40 PO BOX 12138 41 A'Beckett St. 42 Melbourne 3000 43 Australia 44 45 46 06 May 08 SHL Rework scope logic to be MT capable 45 47 26 May 08 SHL Show TID for leaking scope 46 48 17 Jul 08 SHL Add Fortify_PresetOwner Fortify_BecomeOwner Fortify_ChangeScope … … 49 51 18 Jul 08 SHL Rename Fortify_ChangeOwner to Fortify_BecomeOwner 50 52 18 Jul 08 SHL Add reworked Fortify_SetOwner 51 */ 53 54 ***************************************************************************************/ 52 55 53 56 #ifdef FORTIFY … … 62 65 63 66 64 / * the user's options */67 // the user's options 65 68 #include "ufortify.h" 66 69 67 / * Prototypes and such */70 // Prototypes and such 68 71 #define __FORTIFY_C__ // Suppress malloc replacement etc. 69 72 #include "fortify.h" … … 81 84 #endif 82 85 83 /* 86 /** 84 87 * Round x up to the nearest multiple of n. 85 88 */ 86 89 #define ROUND_UP(x, n) ((((x) + (n)-1)/(n))*(n)) 87 90 88 /* 91 /** 89 92 * struct Header - this structure is used 90 93 * internally by Fortify to manage it's … … 93 96 struct Header 94 97 { 95 unsigned short Checksum; / * For the integrity of our goodies */96 const char *File; / * The sourcefile of the allocator */97 unsigned long Line; / * The sourceline of the allocator */98 unsigned short Checksum; // For the integrity of our goodies 99 const char *File; // The sourcefile of the allocator 100 unsigned long Line; // The sourceline of the allocator 98 101 # ifdef FORTIFY_TRACK_DEALLOCATED_MEMORY 99 const char *FreedFile; / * The sourcefile of the deallocator */100 unsigned long FreedLine; / * The sourceline of the deallocator */101 unsigned char Deallocator; / * The deallocator used */102 const char *FreedFile; // The sourcefile of the deallocator 103 unsigned long FreedLine; // The sourceline of the deallocator 104 unsigned char Deallocator; // The deallocator used 102 105 # endif 103 size_t Size; / * The size of the malloc'd block */104 struct Header *Prev; / * Previous link */105 struct Header *Next; / * Next link */106 char *Label; /* User's Label (may be null) */107 unsigned char Scope; / * Scope level of the owner */108 unsigned char Allocator; / * malloc/realloc/new/etc */106 size_t Size; // The size of the malloc'd block 107 struct Header *Prev; // Previous link 108 struct Header *Next; // Next link 109 char *Label; // User's Label (may be null) 110 unsigned char Scope; // Scope level of the owner 111 unsigned char Allocator; // malloc/realloc/new/etc 109 112 # ifdef MT_SCOPES 110 unsigned short Owner; / * TID ordinal of block owner */113 unsigned short Owner; // TID ordinal of block owner 111 114 # endif 112 115 }; … … 115 118 116 119 117 /* 120 /** 118 121 * FORTIFY_ALIGNED_BEFORE_SIZE is FORTIFY_BEFORE_SIZE rounded up to the 119 122 * next multiple of FORTIFY_ALIGNMENT. This is so that we can guarantee … … 125 128 - FORTIFY_HEADER_SIZE) 126 129 127 /* 130 /** 128 131 * FORTIFY_OVERHEAD is the total overhead added by Fortify to each 129 132 * memory block. … … 134 137 135 138 136 /* 137 * 138 * Static Function Prototypes 139 * 140 */ 139 // Static Function Prototypes 141 140 static int st_CheckBlock(struct Header *h, const char *file, unsigned long line); 142 141 static int st_CheckFortification (unsigned char *ptr, unsigned char value, size_t size); … … 160 159 #ifdef FORTIFY_VERBOSE_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 161 160 static const char *st_DeallocatedMemoryBlockString(struct Header *h); 162 #endif / * FORTIFY_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY */163 164 #endif / * FORTIFY_VERBOSE_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY */161 #endif // FORTIFY_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 162 163 #endif // FORTIFY_VERBOSE_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 165 164 static int st_IsOnDeallocatedList(struct Header *h); 166 165 static int st_PurgeDeallocatedBlocks(unsigned long Bytes, const char *file, unsigned long line); … … 168 167 static int st_CheckDeallocatedBlock(struct Header *h, const char *file, unsigned long line); 169 168 static void st_FreeDeallocatedBlock(struct Header *h, const char *file, unsigned long line); 170 #endif /* FORTIFY_TRACK_DEALLOCATED_MEMORY */ 171 172 173 /* 174 * 175 * Static variables 176 * 177 */ 169 #endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 170 171 172 // Static variables 178 173 static struct Header *st_AllocatedHead; 179 174 static int st_AllocateFailRate; … … 198 193 static unsigned long st_DeleteLine[FORTIFY_DELETE_STACK_SIZE]; 199 194 static unsigned long st_DeleteStackTop; 200 #endif / * __cplusplus */201 202 / * statistics */195 #endif // __cplusplus 196 197 // statistics 203 198 static unsigned long st_MaxBlocks = 0; 204 199 static unsigned long st_MaxAllocation = 0; … … 217 212 218 213 219 / * allocators */214 // allocators 220 215 static const char *st_AllocatorName[] = 221 216 { … … 228 223 }; 229 224 230 / * deallocators */225 // deallocators 231 226 static const char *st_DeallocatorName[] = 232 227 { … … 254 249 255 250 256 /* 251 /** 257 252 * Fortify_Allocate() - allocate a block of fortified memory 258 253 */ … … 268 263 #endif 269 264 270 /* 271 * If Fortify has been disabled, then it's easy 272 */ 265 // If Fortify has been disabled, then it's easy 273 266 if(st_Disabled) 274 267 { … … 277 270 || allocator == Fortify_Allocator_array_new)) 278 271 { 279 /* 272 /** 280 273 * A new of zero bytes must succeed, but a malloc of 281 274 * zero bytes probably won't … … 306 299 } 307 300 308 /* Check to see if this allocation will 301 /** 302 * Check to see if this allocation will 309 303 * push us over the artificial limit 310 304 */ … … 330 324 st_Output(st_Buffer); 331 325 } 332 #endif / * FORTIFY_WARN_ON_ZERO_MALLOC */326 #endif // FORTIFY_WARN_ON_ZERO_MALLOC 333 327 334 328 #ifdef FORTIFY_FAIL_ON_ZERO_MALLOC … … 341 335 st_AllocatorName[allocator], (unsigned long)size, file, line); 342 336 st_Output(st_Buffer); 343 #endif / * FORTIFY_WARN_ON_ALLOCATE_FAIL */337 #endif // FORTIFY_WARN_ON_ALLOCATE_FAIL 344 338 return 0; 345 339 } 346 #endif / * FORTIFY_FAIL_ON_ZERO_MALLOC */340 #endif // FORTIFY_FAIL_ON_ZERO_MALLOC 347 341 348 342 #ifdef FORTIFY_WARN_ON_SIZE_T_OVERFLOW 349 /* 343 /** 350 344 * Ensure the size of the memory block 351 345 * plus the overhead isn't bigger than … … 370 364 do 371 365 { 372 /* 366 /** 373 367 * malloc the memory, including the space 374 368 * for the header and fortification buffers … … 380 374 381 375 # ifdef FORTIFY_TRACK_DEALLOCATED_MEMORY 382 /* 376 /** 383 377 * If we're tracking deallocated memory, then 384 378 * we can free some of it, rather than let … … 389 383 another_try = st_PurgeDeallocatedBlocks(size, file, line); 390 384 } 391 # endif / * FORTIFY_TRACK_DEALLOCATED_MEMORY */385 # endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 392 386 393 387 } … … 404 398 } 405 399 406 /* 407 * Begin Critical Region 408 */ 400 // Begin Critical Region 409 401 FORTIFY_LOCK(); 410 402 411 403 412 /* 404 /** 413 405 * Make the head's prev pointer point to us 414 406 * ('cos we're about to become the head) … … 417 409 { 418 410 st_CheckBlock(st_AllocatedHead, file, line); 419 / * what should we do if this fails? (apart from panic) */411 // what should we do if this fails? (apart from panic) 420 412 421 413 st_AllocatedHead->Prev = (struct Header *)ptr; … … 427 419 # endif 428 420 429 /* 430 * Initialize and validate the header 431 */ 421 // Initialize and validate the header 432 422 h = (struct Header *)ptr; 433 423 h->Size = size; … … 448 438 h->FreedLine = 0; 449 439 h->Deallocator = Fortify_Deallocator_nobody; 450 #endif / * FORTIFY_TRACK_DEALLOCATED_MEMORY */440 #endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 451 441 st_MakeHeaderValid(h); 452 442 st_AllocatedHead = h; 453 443 454 /* 455 * Initialize the fortifications 456 */ 444 // Initialize the fortifications 457 445 st_SetFortification(ptr + FORTIFY_HEADER_SIZE, 458 446 FORTIFY_BEFORE_VALUE, FORTIFY_ALIGNED_BEFORE_SIZE); … … 461 449 462 450 # ifdef FORTIFY_FILL_ON_ALLOCATE 463 /* 464 * Fill the actual user memory 465 */ 451 // Fill the actual user memory 466 452 st_SetFortification(ptr + FORTIFY_HEADER_SIZE + FORTIFY_ALIGNED_BEFORE_SIZE, 467 453 FORTIFY_FILL_ON_ALLOCATE_VALUE, size); 468 454 # endif 469 455 470 /* 471 * End Critical Region 472 */ 456 // End Critical Region 473 457 FORTIFY_UNLOCK(); 474 458 475 459 476 /* 477 * update the statistics 478 */ 460 // update the statistics 479 461 st_TotalAllocation += size; 480 462 st_Allocations++; … … 486 468 st_MaxAllocation = st_CurAllocation; 487 469 488 /* 470 /** 489 471 * We return the address of the user's memory, not the start of the block, 490 472 * which points to our magic cookies … … 495 477 496 478 497 /* 479 /** 498 480 * Fortify_Deallocate() - Free a block of memory allocated with Fortify_Allocate() 499 481 */ … … 516 498 # endif 517 499 518 /* 519 * If Fortify has been disabled, then it's easy 520 * (well, almost) 521 */ 500 // If Fortify has been disabled, then it's easy * (well, almost) 522 501 if(st_Disabled) 523 502 { 524 /* there is a possibility that this memory 525 * block was allocated when Fortify was 526 * enabled, so we must check the Allocated 527 * list before we free it. 528 */ 503 /** 504 *there is a possibility that this memory 505 * block was allocated when Fortify was 506 * enabled, so we must check the Allocated 507 * list before we free it. 508 */ 529 509 if(!st_IsOnAllocatedList(h)) 530 510 { … … 534 514 else 535 515 { 536 /* the block was allocated by Fortify, so we 537 * gotta free it differently. 538 */ 539 /* 540 * Begin critical region 541 */ 542 FORTIFY_LOCK(); 543 544 /* 545 * Remove the block from the list 546 */ 547 if(h->Prev) 548 h->Prev->Next = h->Next; 549 else 550 st_AllocatedHead = h->Next; 551 552 if(h->Next) 553 h->Next->Prev = h->Prev; 554 555 /* 556 * End Critical Region 557 */ 558 FORTIFY_UNLOCK(); 559 560 /* 561 * actually free the memory 562 */ 563 free(ptr); 564 return; 516 /** 517 * the block was allocated by Fortify, so we 518 * gotta free it differently. 519 */ 520 // Begin critical region 521 FORTIFY_LOCK(); 522 523 // Remove the block from the list 524 if(h->Prev) 525 h->Prev->Next = h->Next; 526 else 527 st_AllocatedHead = h->Next; 528 529 if(h->Next) 530 h->Next->Prev = h->Prev; 531 532 // End Critical Region 533 FORTIFY_UNLOCK(); 534 535 // actually free the memory 536 free(ptr); 537 return; 565 538 } 566 539 } … … 584 557 return; 585 558 } 586 # endif / * FORTIFY_TRACK_DEALLOCATED_MEMORY */559 # endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 587 560 588 561 # ifdef FORTIFY_NO_PERCENT_P … … 597 570 return; 598 571 } 599 # endif / * FORTIFY_PARANOID_DEALLOCATE */600 601 /* 572 # endif // FORTIFY_PARANOID_DEALLOCATE 573 574 /** 602 575 * Make sure the block is okay before we free it. 603 576 * If it's not okay, don't free it - it might not … … 612 585 613 586 # ifdef FORTIFY_TRACK_DEALLOCATED_MEMORY 614 /* 587 /** 615 588 * Make sure the block hasn't been freed already 616 589 * (we can get to here if FORTIFY_PARANOID_DEALLOCATE … … 631 604 return; 632 605 } 633 # endif / * FORTIFY_TRACK_DEALLOCATED_MEMORY */634 635 /* 606 # endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 607 608 /** 636 609 * Make sure the block is being freed with a valid 637 610 * deallocator. If not, complain. (but free it anyway) … … 648 621 } 649 622 650 /* 651 * Begin critical region 652 */ 623 // Begin critical region 653 624 FORTIFY_LOCK(); 654 625 655 /* 656 * Remove the block from the list 657 */ 626 // Remove the block from the list 658 627 if(h->Prev) 659 628 { … … 684 653 } 685 654 686 /* 687 * End Critical Region 688 */ 655 // End Critical Region 689 656 FORTIFY_UNLOCK(); 690 657 691 /* 692 * update the statistics 693 */ 658 // update the statistics 694 659 st_Frees++; 695 660 st_CurBlocks--; … … 704 669 #endif 705 670 { 706 /* 671 /** 707 672 * Don't _actually_ free the memory block, just yet. 708 673 * Place it onto the deallocated list, instead, so … … 710 675 */ 711 676 # ifdef FORTIFY_FILL_ON_DEALLOCATE 712 /* 713 * Nuke out all user memory that is about to be freed 714 */ 677 // Nuke out all user memory that is about to be freed 715 678 st_SetFortification(ptr + FORTIFY_HEADER_SIZE + FORTIFY_ALIGNED_BEFORE_SIZE, 716 679 FORTIFY_FILL_ON_DEALLOCATE_VALUE, 717 680 h->Size); 718 # endif /* FORTIFY_FILL_ON_DEALLOCATE */ 719 720 /* 721 * Begin critical region 722 */ 681 # endif // FORTIFY_FILL_ON_DEALLOCATE 682 683 // Begin critical region 723 684 FORTIFY_LOCK(); 724 685 725 /* 726 * Place the block on the deallocated list 727 */ 686 // Place the block on the deallocated list 728 687 if(st_DeallocatedHead) 729 688 { … … 747 706 748 707 # ifdef FORTIFY_DEALLOCATED_MEMORY_LIMIT 749 /* 750 * If we've got too much on the deallocated list; free some 751 */ 708 // If we've got too much on the deallocated list; free some 752 709 if(st_TotalDeallocated > FORTIFY_DEALLOCATED_MEMORY_LIMIT) 753 710 { … … 756 713 # endif 757 714 758 /* 759 * End critical region 760 */ 715 // End critical region 761 716 FORTIFY_UNLOCK(); 762 717 } 763 718 else 764 # endif /* FORTIFY_TRACK_DEALLOCATED_MEMORY */ 765 { 766 /* 767 * Free the User Label 768 */ 719 # endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 720 { 721 // Free the User Label 769 722 if(h->Label) 770 723 { … … 773 726 774 727 # ifdef FORTIFY_FILL_ON_DEALLOCATE 775 /* 776 * Nuke out all memory that is about to be freed, including the header 777 */ 728 // Nuke out all memory that is about to be freed, including the header 778 729 st_SetFortification(ptr, FORTIFY_FILL_ON_DEALLOCATE_VALUE, 779 730 FORTIFY_HEADER_SIZE + FORTIFY_ALIGNED_BEFORE_SIZE + h->Size + FORTIFY_AFTER_SIZE); 780 # endif /* FORTIFY_FILL_ON_DEALLOCATE */ 781 782 /* 783 * And do the actual free 784 */ 731 # endif // FORTIFY_FILL_ON_DEALLOCATE 732 733 // And do the actual free 785 734 free(ptr); 786 735 } … … 788 737 789 738 790 /* 739 /** 791 740 * Fortify_LabelPointer() - Labels the memory block 792 741 * with a string provided by the user. This function … … 804 753 struct Header *h = (struct Header *)ptr; 805 754 806 / * make sure the pointer is okay */755 // make sure the pointer is okay 807 756 Fortify_CheckPointer(uptr, file, line); 808 757 809 / * free the previous label */758 // free the previous label 810 759 if(h->Label) 811 760 { … … 813 762 } 814 763 815 / * make sure the label is sensible */764 // make sure the label is sensible 816 765 assert(label); 817 766 818 / * copy it in */767 // copy it in 819 768 h->Label = (char*)malloc(strlen(label)+1); 820 769 strcpy(h->Label, label); 821 770 822 / * update the checksum */771 // update the checksum 823 772 st_MakeHeaderValid(h); 824 773 } 825 774 } 826 775 827 /* 776 /** 828 777 * Fortify_CheckPointer() - Returns true if the uptr 829 778 * points to a valid piece of Fortify_Allocated()'d … … 883 832 } 884 833 885 /* 834 /** 886 835 * Fortify_SetOutputFunc(Fortify_OutputFuncPtr Output) - 887 836 * Sets the function used to output all error and … … 901 850 } 902 851 903 /* 852 /** 904 853 * Fortify_SetAllocateFailRate(int Percent) - 905 854 * Fortify_Allocate() will "fail" this Percent of … … 920 869 921 870 922 /* 871 /** 923 872 * Fortify_CheckAllMemory() - Checks the fortifications 924 873 * of all memory on the allocated list. And, if … … 939 888 FORTIFY_LOCK(); 940 889 941 /* 942 * Check the allocated memory 943 */ 890 // Check the allocated memory 944 891 while(curr) 945 892 { … … 950 897 } 951 898 952 /* 953 * Check the deallocated memory while you're at it 954 */ 899 // Check the deallocated memory while you're at it 955 900 # ifdef FORTIFY_TRACK_DEALLOCATED_MEMORY 956 901 curr = st_DeallocatedHead; … … 964 909 # endif 965 910 966 /* 911 /** 967 912 * If we know where we are, and everything is cool, 968 913 * remember that. It might be important. … … 979 924 980 925 981 /* 926 /** 982 927 * Fortify_EnterScope() - enters a new Fortify scope 983 928 * level. Returns the new scope level. … … 1019 964 } 1020 965 1021 /* Fortify_LeaveScope - leaves a Fortify scope level, 966 /** 967 * Fortify_LeaveScope - leaves a Fortify scope level, 1022 968 * also prints a memory dump of all non-freed memory 1023 969 * that was allocated during the scope being exited. … … 1109 1055 1110 1056 # ifdef FORTIFY_TRACK_DEALLOCATED_MEMORY 1111 /* 1057 /** 1112 1058 * Quietly free all the deallocated memory 1113 1059 * that was allocated in this scope that … … 1120 1066 st_PurgeDeallocatedScope( st_Scope, file, line ); 1121 1067 # endif 1122 # endif / * FORTIFY_TRACK_DEALLOCATED_MEMORY */1068 # endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 1123 1069 1124 1070 FORTIFY_UNLOCK(); … … 1130 1076 } 1131 1077 1132 /* 1078 /** 1133 1079 * Fortify_ListAllMemory() - Outputs the entire 1134 1080 * list of currently allocated memory. For each block … … 1180 1126 } 1181 1127 1182 /* 1128 /** 1183 1129 * Fortify_DumpAllMemory() - Outputs the entire list of 1184 1130 * currently allocated memory. For each allocated block … … 1218 1164 } 1219 1165 1220 /* Fortify_OutputStatistics() - displays statistics 1166 /** 1167 * Fortify_OutputStatistics() - displays statistics 1221 1168 * about the maximum amount of memory that was 1222 1169 * allocated at any one time. … … 1252 1199 } 1253 1200 1254 /* Fortify_GetCurrentAllocation() - returns the number of 1201 /** 1202 * Fortify_GetCurrentAllocation() - returns the number of 1255 1203 * bytes currently allocated. 1256 1204 */ … … 1264 1212 } 1265 1213 1266 /* Fortify_SetAllocationLimit() - set a limit on the total 1214 /** 1215 * Fortify_SetAllocationLimit() - set a limit on the total 1267 1216 * amount of memory allowed for this application. 1268 1217 */ … … 1273 1222 } 1274 1223 1275 /* 1224 /** 1276 1225 * Fortify_Disable() - Run time method of disabling Fortify. 1277 1226 * Useful if you need to turn off Fortify without recompiling … … 1289 1238 { 1290 1239 # ifdef FORTIFY_TRACK_DEALLOCATED_MEMORY 1291 / * free all deallocated memory we might be tracking */1240 // free all deallocated memory we might be tracking 1292 1241 st_PurgeDeallocatedScope( 0, file, line ); 1293 # endif / * FORTIFY_TRACK_DEALLOCATED_MEMORY */1242 # endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 1294 1243 1295 1244 st_Disabled = 1; … … 1298 1247 1299 1248 1300 /* 1249 /** 1301 1250 * st_CheckBlock - Check a block's header and fortifications. 1302 1251 * Returns true if the block is happy. … … 1364 1313 #ifdef FORTIFY_TRACK_DEALLOCATED_MEMORY 1365 1314 1366 /* 1315 /** 1367 1316 * st_CheckDeallocatedBlock - Check a deallocated block's header and fortifications. 1368 1317 * Returns true if the block is happy. … … 1450 1399 st_SetFortification(ptr + FORTIFY_HEADER_SIZE + FORTIFY_ALIGNED_BEFORE_SIZE, 1451 1400 FORTIFY_FILL_ON_DEALLOCATE_VALUE, h->Size); 1452 # endif / * FORTIFY_FILL_ON_CORRUPTION */1401 # endif // FORTIFY_FILL_ON_CORRUPTION 1453 1402 result = 0; 1454 1403 } 1455 #endif / * FORTIFY_FILL_ON_DEALLOCATE */1404 #endif // FORTIFY_FILL_ON_DEALLOCATE 1456 1405 return result; 1457 1406 } 1458 1407 1459 #endif / * FORTIFY_TRACK_DEALLOCATED_MEMORY */1460 1461 1462 /* 1408 #endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 1409 1410 1411 /** 1463 1412 * st_CheckFortification - Checks if the _size_ 1464 1413 * bytes from _ptr_ are all set to _value_ … … 1475 1424 } 1476 1425 1477 /* 1426 /** 1478 1427 * st_SetFortification - Set the _size_ bytes from _ptr_ to _value_. 1479 1428 */ … … 1484 1433 } 1485 1434 1486 /* 1435 /** 1487 1436 * st_OutputFortification - Output the corrupted section of the fortification 1488 1437 */ … … 1498 1447 while(offset < size) 1499 1448 { 1500 /* 1501 * Skip 3 or more 'correct' lines 1502 */ 1449 // Skip 3 or more 'correct' lines 1503 1450 if((size - offset) < 3 * 16) 1504 1451 advance = size - offset; … … 1542 1489 } 1543 1490 1544 /* 1491 /** 1545 1492 * st_HexDump - output a nice hex dump of "size" bytes, starting at "ptr" + "offset" 1546 1493 */ … … 1608 1555 } 1609 1556 1610 /* 1557 /** 1611 1558 * st_IsHeaderValid - Returns true if the 1612 1559 * supplied pointer does indeed point to a … … 1619 1566 } 1620 1567 1621 /* 1568 /** 1622 1569 * st_MakeHeaderValid - Updates the checksum 1623 1570 * to make the header valid … … 1630 1577 } 1631 1578 1632 /* 1579 /** 1633 1580 * st_ChecksumHeader - Calculate (and return) 1634 1581 * the checksum of the header. (Including the … … 1651 1598 } 1652 1599 1653 /* 1600 /** 1654 1601 * st_IsOnAllocatedList - Examines the allocated 1655 1602 * list to see if the given header is on it. … … 1673 1620 1674 1621 #ifdef FORTIFY_TRACK_DEALLOCATED_MEMORY 1675 /* 1622 1623 /** 1676 1624 * st_IsOnDeallocatedList - Examines the deallocated 1677 1625 * list to see if the given header is on it. … … 1694 1642 } 1695 1643 1696 /* 1644 /** 1697 1645 * st_PurgeDeallocatedBlocks - free at least "Bytes" 1698 1646 * worth of deallocated memory, starting at the … … 1710 1658 file, line); 1711 1659 st_Output(st_Buffer); 1712 # endif / * FORTIFY_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY */1660 # endif // FORTIFY_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 1713 1661 1714 1662 while(st_DeallocatedTail && FreedBytes < Bytes) … … 1722 1670 st_DeallocatedMemoryBlockString(st_DeallocatedTail)); 1723 1671 st_Output(st_Buffer); 1724 # endif / * FORTIFY_VERBOSE_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY */1725 # endif / * FORTIFY_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY */1672 # endif // FORTIFY_VERBOSE_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 1673 # endif // FORTIFY_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 1726 1674 st_FreeDeallocatedBlock(st_DeallocatedTail, file, line); 1727 1675 } … … 1730 1678 } 1731 1679 1732 /* 1680 /** 1733 1681 * st_PurgeDeallocatedScope - free all deallocated 1734 1682 * memory blocks that were allocated within "Scope" … … 1763 1711 } 1764 1712 1765 /* 1713 /** 1766 1714 * st_FreeDeallocatedBlock - actually remove 1767 1715 * a deallocated block from the deallocated … … 1773 1721 st_CheckDeallocatedBlock( h, file, line ); 1774 1722 1775 /* 1776 * Begin Critical region 1777 */ 1723 // Begin Critical region 1778 1724 FORTIFY_LOCK(); 1779 1725 … … 1804 1750 } 1805 1751 1806 /* 1807 * Free the label 1808 */ 1752 // Free the label 1809 1753 if(h->Label) 1810 1754 { … … 1812 1756 } 1813 1757 1814 /* 1815 * Nuke out all memory that is about to be freed, including the header 1816 */ 1758 // Nuke out all memory that is about to be freed, including the header 1817 1759 st_SetFortification((unsigned char*)h, FORTIFY_FILL_ON_DEALLOCATE_VALUE, 1818 1760 FORTIFY_HEADER_SIZE + FORTIFY_ALIGNED_BEFORE_SIZE + h->Size + FORTIFY_AFTER_SIZE); 1819 1761 1820 /* 1821 * And do the actual free 1822 */ 1762 // And do the actual free 1823 1763 free(h); 1824 1764 1825 /* 1826 * End critical region 1827 */ 1765 // End critical region 1828 1766 FORTIFY_UNLOCK(); 1829 1767 } 1830 1768 1831 #endif / * FORTIFY_TRACK_DEALLOCATED_MEMORY */1832 1833 /* 1769 #endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 1770 1771 /** 1834 1772 * st_OutputMemory - Hex and ascii dump the 1835 1773 * user memory of a block. … … 1843 1781 1844 1782 1845 /* 1783 /** 1846 1784 * st_OutputHeader - Output the header 1847 1785 */ … … 1908 1846 } 1909 1847 1910 /* 1848 /** 1911 1849 * st_OutputLastVerifiedPoint - output the last 1912 1850 * known point where everything was hoopy. … … 1921 1859 } 1922 1860 1923 /* 1861 /** 1924 1862 * st_MemoryBlockString - constructs a string that 1925 1863 * desribes a memory block. (pointer,size,allocator,label) … … 1961 1899 #ifdef FORTIFY_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 1962 1900 #ifdef FORTIFY_VERBOSE_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 1963 /* 1901 1902 /** 1964 1903 * st_DeallocatedMemoryBlockString - constructs 1965 1904 * a string that desribes a deallocated memory … … 1995 1934 return st_BlockString; 1996 1935 } 1997 #endif / * FORTIFY_VERBOSE_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY */1998 #endif / * FORTIFY_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY */1999 #endif / * FORTIFY_TRACK_DEALLOCATED_MEMORY */2000 2001 2002 /* 1936 #endif // FORTIFY_VERBOSE_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 1937 #endif // FORTIFY_WARN_WHEN_DISCARDING_DEALLOCATED_MEMORY 1938 #endif // FORTIFY_TRACK_DEALLOCATED_MEMORY 1939 1940 1941 /** 2003 1942 * st_DefaultOutput - the default output function 2004 1943 */ … … 2010 1949 } 2011 1950 2012 /* 1951 /** 2013 1952 * Fortify_malloc - Fortify's replacement malloc() 2014 1953 */ … … 2019 1958 } 2020 1959 2021 /* 1960 /** 2022 1961 * Fortify_realloc - Fortify's replacement realloc() 2023 1962 */ … … 2029 1968 void *new_ptr; 2030 1969 2031 /* 2032 * If Fortify is disabled, we gotta do this a little 2033 * differently. 2034 */ 1970 // If Fortify is disabled, we gotta do this a little differently. 2035 1971 if(!st_Disabled) 2036 1972 { … … 2084 2020 else 2085 2021 { 2086 /* 2087 * If the old block was fortified, we can't use normal realloc. 2088 */ 2022 // If the old block was fortified, we can't use normal realloc. 2089 2023 if(st_IsOnAllocatedList(h)) 2090 2024 { … … 2101 2035 return(new_ptr); 2102 2036 } 2103 else / * easy */2037 else // easy 2104 2038 { 2105 2039 return realloc(uptr, new_size); … … 2108 2042 } 2109 2043 2110 /* 2044 /** 2111 2045 * Fortify_calloc - Fortify's replacement calloc 2112 2046 */ … … 2129 2063 } 2130 2064 2131 /* 2065 /** 2132 2066 * Fortify_free - Fortify's replacement free 2133 2067 */ … … 2135 2069 Fortify_free(void *uptr, const char *file, unsigned long line) 2136 2070 { 2137 / * it is defined to be safe to free(0) */2071 // it is defined to be safe to free(0) 2138 2072 if(uptr == 0) 2139 2073 return; … … 2142 2076 } 2143 2077 2144 /* 2078 /** 2145 2079 * Fortify_strdup - Fortify's replacement strdup. Since strdup isn't 2146 2080 * ANSI, it is only provided if FORTIFY_STRDUP is defined. … … 2165 2099 } 2166 2100 } 2167 #endif / * FORTIFY_STRDUP */2101 #endif // FORTIFY_STRDUP 2168 2102 2169 2103 static void … … 2188 2122 #ifdef __cplusplus 2189 2123 2190 /* 2124 /** 2191 2125 * st_NewHandler() - there is no easy way to get 2192 2126 * the new handler function. And isn't it great … … 2198 2132 st_NewHandler() 2199 2133 { 2200 / * get the current handler */2134 // get the current handler 2201 2135 Fortify_NewHandlerFunc handler = set_new_handler(0); 2202 2136 2203 /* and set it back (since we cant 2204 * get it without changing it) 2205 */ 2137 // and set it back (since we cant get it without changing it) 2206 2138 set_new_handler(handler); 2207 2139 … … 2209 2141 } 2210 2142 2211 /* 2143 /** 2212 2144 * operator new - Fortify's replacement new, 2213 2145 * without source-code information. … … 2230 2162 } 2231 2163 2232 /* 2164 /** 2233 2165 * operator new - Fortify's replacement new, 2234 2166 * with source-code information … … 2252 2184 #ifdef FORTIFY_PROVIDE_ARRAY_NEW 2253 2185 2254 /* 2186 /** 2255 2187 * operator new[], without source-code info 2256 2188 */ … … 2272 2204 } 2273 2205 2274 /* 2206 /** 2275 2207 * operator new[], with source-code info 2276 2208 */ … … 2291 2223 } 2292 2224 2293 #endif / * FORTIFY_PROVIDE_ARRAY_NEW */2294 2295 /* 2225 #endif // FORTIFY_PROVIDE_ARRAY_NEW 2226 2227 /** 2296 2228 * Fortify_PreDelete - C++ does not allow overloading 2297 2229 * of delete, so the delete macro calls Fortify_PreDelete … … 2303 2235 FORTIFY_LOCK(); 2304 2236 2305 /* 2237 /** 2306 2238 * Push the source code info for the delete onto the delete stack 2307 2239 * (if we have enough room, of course) … … 2316 2248 } 2317 2249 2318 /* 2250 /** 2319 2251 * Fortify_PostDelete() - Pop the delete source-code info 2320 2252 * off the source stack. … … 2328 2260 } 2329 2261 2330 /* 2262 /** 2331 2263 * operator delete - fortify's replacement delete 2332 2264 */ … … 2337 2269 unsigned long line; 2338 2270 2339 /* 2340 * It is defined to be harmless to delete 0 2341 */ 2271 // It is defined to be harmless to delete 0 2342 2272 if(uptr == 0) 2343 2273 return; 2344 2274 2345 /* 2346 * find the source-code info 2347 */ 2275 // find the source-code info 2348 2276 if(st_DeleteStackTop) 2349 2277 { … … 2370 2298 #ifdef FORTIFY_PROVIDE_ARRAY_DELETE 2371 2299 2372 /* 2300 /** 2373 2301 * operator delete[] - fortify's replacement delete[] 2374 2302 */ … … 2379 2307 unsigned long line; 2380 2308 2381 /* 2382 * It is defined to be harmless to delete 0 2383 */ 2309 // It is defined to be harmless to delete 0 2384 2310 if(uptr == 0) 2385 2311 return; 2386 2312 2387 /* 2388 * find the source-code info 2389 */ 2313 // find the source-code info 2390 2314 if(st_DeleteStackTop) 2391 2315 { … … 2410 2334 } 2411 2335 2412 #endif / * FORTIFY_PROVIDE_ARRAY_DELETE */2336 #endif // FORTIFY_PROVIDE_ARRAY_DELETE 2413 2337 2414 2338 #ifdef FORTIFY_AUTOMATIC_LOG_FILE 2415 /* Automatic log file stuff! 2339 /** 2340 * Automatic log file stuff! 2416 2341 * 2417 2342 * AutoLogFile class. There can only ever be ONE of these … … 2482 2407 static Fortify_AutoLogFile Abracadabra; 2483 2408 2484 #endif / * FORTIFY_AUTOMATIC_LOG_FILE */2485 2486 #endif / * __cplusplus */2409 #endif // FORTIFY_AUTOMATIC_LOG_FILE 2410 2411 #endif // __cplusplus 2487 2412 2488 2413 #ifdef MT_SCOPES … … 2599 2524 #endif // MT_SCOPES 2600 2525 2601 #endif / * FORTIFY */2526 #endif // FORTIFY -
trunk/dll/getnames.c
r1545 r1673 51 51 if (!loadedudirs) 52 52 load_udirs(); 53 { / * fill user list box */53 { // fill user list box 54 54 ULONG ulDriveNum, ulDriveMap; 55 55 ULONG ulSearchCount; … … 116 116 case WM_CONTROL: 117 117 switch (SHORT1FROMMP(mp1)) { 118 case 260: / * drives dropdown list */118 case 260: // drives dropdown list 119 119 switch (SHORT2FROMMP(mp1)) { 120 120 case CBN_SHOWLIST: … … 125 125 break; 126 126 127 case 258: / * name entry field */127 case 258: // name entry field 128 128 switch (SHORT2FROMMP(mp1)) { 129 129 case EN_SETFOCUS: … … 137 137 break; 138 138 139 case 264: / * dirs listbox */139 case 264: // dirs listbox 140 140 switch (SHORT2FROMMP(mp1)) { 141 141 case LN_SETFOCUS: … … 149 149 break; 150 150 151 case 266: / * files listbox */151 case 266: // files listbox 152 152 switch (SHORT2FROMMP(mp1)) { 153 153 case LN_SETFOCUS: … … 295 295 if (!DosQueryPathInfo(filename, FIL_STANDARD, &fsa, sizeof(fsa))) { 296 296 if (fsa.attrFile & FILE_DIRECTORY) { 297 / * device or directory */297 // device or directory 298 298 saymsg(MB_CANCEL | MB_ICONEXCLAMATION, 299 299 hwnd, filename, GetPString(IDS_EXISTSBUTNOTFILETEXT), filename); … … 380 380 MakeFullName(filename); 381 381 if (!DosQueryPathInfo(filename, FIL_STANDARD, &fsa, sizeof(fsa))) { 382 if (fsa.attrFile & FILE_DIRECTORY) { / * device or directory */382 if (fsa.attrFile & FILE_DIRECTORY) { // device or directory 383 383 saymsg(MB_CANCEL | MB_ICONEXCLAMATION, 384 384 hwnd, filename, GetPString(IDS_EXISTSBUTNOTFILETEXT), filename); -
trunk/dll/grep.c
r1668 r1673 146 146 } 147 147 148 /* 148 /** 149 149 * this function originally from C_ECHO's Snippets -- modified 150 150 * brute force methodology -
trunk/dll/i18nutil.c
r1400 r1673 20 20 ***********************************************************************/ 21 21 22 /* 22 /** 23 23 * COMMAFMT.C 24 24 * Adapted from public domain code by Bob Stout -
trunk/dll/info.c
r1544 r1673 383 383 } ICONSTUF; 384 384 385 /* 385 /** 386 386 * subclass routine to allow changing a program's icon 387 387 */ -
trunk/dll/inis.c
r1554 r1673 244 244 (PSZ) inirec->app, 245 245 NULL, (PULONG) & ulSize) && ulSize) { 246 pDataK = xmalloc(ulSize, pszSrcFile, __LINE__); / * allocate space for keynames */246 pDataK = xmalloc(ulSize, pszSrcFile, __LINE__); // allocate space for keynames 247 247 if (pDataK) { 248 / * get keynames */248 // get keynames 249 249 if (PrfQueryProfileString(hiniTo, 250 250 (PSZ) inirec->app, 251 251 NULL, "\0", pDataK, ulSize)) { 252 252 pCurrentK = pDataK; 253 / * step through keynames */253 // step through keynames 254 254 while (*pCurrentK) { 255 255 if (PrfQueryProfileSize(hiniTo, inirec->app, … … 258 258 pData = xmalloc(ulSize, pszSrcFile, __LINE__); 259 259 if (pData) { 260 / * get data */260 // get data 261 261 if (PrfQueryProfileData(hiniTo, inirec->app, 262 262 pCurrentK, 263 263 pData, (PULONG) & ulSize)) 264 / * write data to new ini file */264 // write data to new ini file 265 265 PrfWriteProfileData(hiniFrom, ((*inirec->app2) ? 266 266 inirec-> 267 267 app2 : inirec->app), 268 268 pCurrentK, pData, ulSize); 269 free(pData); / * free data */269 free(pData); // free data 270 270 } 271 271 } 272 while (*pCurrentK) / * next keyname */272 while (*pCurrentK) // next keyname 273 273 pCurrentK++; 274 274 pCurrentK++; 275 275 } 276 276 } 277 free(pDataK); / * free keynames */277 free(pDataK); // free keynames 278 278 } 279 279 } … … 301 301 pData = xmalloc(ulSize, pszSrcFile, __LINE__); 302 302 if (pData) { 303 / * get data */303 // get data 304 304 if (PrfQueryProfileData(hiniTo, inirec->app, 305 305 inirec->key, 306 306 pData, (PULONG) & ulSize)) 307 / * write data to new ini file */307 // write data to new ini file 308 308 PrfWriteProfileData(hiniFrom, ((*inirec->app2) ? 309 309 inirec->app2 : inirec->app), … … 311 311 inirec->key2 : inirec->key), 312 312 pData, ulSize); 313 free(pData); / * free data */313 free(pData); // free data 314 314 } 315 315 } … … 429 429 if (PrfQueryProfileSize(orig, NULL, NULL, (PULONG) & ulSize) 430 430 && ulSize) { 431 pDataA = xmalloc(ulSize, pszSrcFile, __LINE__); / * allocate space for applnames */431 pDataA = xmalloc(ulSize, pszSrcFile, __LINE__); /// allocate space for applnames 432 432 if (pDataA) { 433 / * get applnames */433 // get applnames 434 434 if (PrfQueryProfileString 435 435 (orig, NULL, NULL, "\0", pDataA, ulSize)) { 436 436 pCurrentA = pDataA; 437 / * step through applnames */437 // step through applnames 438 438 while (*pCurrentA) { 439 / * now keynames for this applname */439 // now keynames for this applname 440 440 if (PrfQueryProfileSize(orig, (PSZ) pCurrentA, NULL, 441 441 (PULONG) & ulSize) && ulSize) { 442 pDataK = xmalloc(ulSize, pszSrcFile, __LINE__); / * allocate space for keynames */442 pDataK = xmalloc(ulSize, pszSrcFile, __LINE__); // allocate space for keynames 443 443 if (pDataK) { 444 / * get keynames */444 // get keynames 445 445 if (PrfQueryProfileString(orig, (PSZ) pCurrentA, NULL, 446 446 "\0", pDataK, ulSize)) { 447 447 pCurrentK = pDataK; 448 / * step through keynames */448 // step through keynames 449 449 while (*pCurrentK) { 450 450 if (PrfQueryProfileSize(orig, pCurrentA, … … 454 454 pData = xmalloc(ulSize, pszSrcFile, __LINE__); 455 455 if (pData) { 456 / * get data */456 // get data 457 457 if (PrfQueryProfileData(orig, pCurrentA, 458 458 pCurrentK, 459 459 pData, 460 460 (PULONG) & ulSize)) 461 / * write data to new ini file */461 // write data to new ini file 462 462 PrfWriteProfileData(new, pCurrentA, 463 463 pCurrentK, pData, 464 464 ulSize); 465 free(pData); / * free data */465 free(pData); // free data 466 466 } 467 467 } 468 while (*pCurrentK) / * next keyname */468 while (*pCurrentK) // next keyname 469 469 pCurrentK++; 470 470 pCurrentK++; 471 471 } 472 472 } 473 free(pDataK); / * free keynames */473 free(pDataK); // free keynames 474 474 } 475 475 } 476 while (*pCurrentA) / * next applname */476 while (*pCurrentA) // next applname 477 477 pCurrentA++; 478 478 pCurrentA++; 479 479 } 480 480 } 481 free(pDataA); / * free applnames */481 free(pDataA); // free applnames 482 482 } 483 483 } … … 1178 1178 } 1179 1179 CloseProfile(testini, FALSE); 1180 / * make copies of new inis */1180 // make copies of new inis 1181 1181 *tempuserini = 0; 1182 1182 *tempsysini = 0; … … 1217 1217 } 1218 1218 else { 1219 / * backup old inis */1219 // backup old inis 1220 1220 strcpy(tempuserini2, olduserini); 1221 1221 p = strrchr(tempuserini2, '\\'); … … 1260 1260 break; 1261 1261 } 1262 / * copy new inis to old ini names */1262 // copy new inis to old ini names 1263 1263 rc = DosCopy(userini, olduserini, DCPY_EXISTING); 1264 1264 if (rc) { … … 1285 1285 break; 1286 1286 } 1287 / * replace temp inis with new permanent inis */1287 // replace temp inis with new permanent inis 1288 1288 memset(&prfp, 0, sizeof(PRFPROFILE)); 1289 1289 prfp.cchUserName = strlen(oldsysini); … … 1515 1515 HWND StartIniEditor(HWND hwnd, CHAR *fname, INT flags) 1516 1516 { 1517 /* 1517 /** 1518 1518 * create an ini editor window 1519 1519 * bitmapped flags: … … 1699 1699 else { 1700 1700 pDItem = DrgQueryDragitemPtr(pDInfo,0); 1701 / * Check valid rendering mechanisms and data */1701 // Check valid rendering mechanisms and data 1702 1702 if (DrgVerifyRMF(pDItem, (CHAR *) DRM_OS2FILE, NULL)) { 1703 1703 DrgFreeDraginfo(pDInfo); 1704 return (MRFROM2SHORT(DOR_DROP, DO_LINK)); / * OK to drop */1704 return (MRFROM2SHORT(DOR_DROP, DO_LINK)); // OK to drop 1705 1705 } 1706 1706 else if (DrgVerifyRMF(pDItem, (CHAR *) DRM_FM2INIRECORD, (CHAR *) DRF_FM2INI)) { … … 1724 1724 { 1725 1725 PDRAGINFO pDInfo = (PDRAGINFO) mp1; 1726 PDRAGITEM pDItem; / * Pointer to DRAGITEM */1726 PDRAGITEM pDItem; // Pointer to DRAGITEM 1727 1727 ULONG numitems, curitem, len; 1728 1728 USHORT action; … … 2044 2044 return 0; 2045 2045 2046 case UM_INITIALSIZE: / * kludge */2046 case UM_INITIALSIZE: // kludge 2047 2047 inidata = INSTDATA(hwnd); 2048 2048 if (!inidata) … … 2086 2086 2087 2087 case UM_LOADFILE: 2088 / * load initial file */2088 // load initial file 2089 2089 inidata = INSTDATA(hwnd); 2090 2090 if (!inidata) … … 2137 2137 WinFillRect(hps, &rcl, CLR_PALEGRAY); 2138 2138 WinEndPaint(hps); 2139 /* 2140 * tell status window to paint its box 2141 */ 2139 // tell status window to paint its box 2142 2140 PaintRecessedWindow(WinWindowFromID(hwnd, INI_APPHDR), 2143 2141 (HPS) 0, FALSE, FALSE); -
trunk/dll/init.c
r1664 r1673 304 304 CHAR *NullStr = ""; 305 305 PCSZ PCSZ_CM_ALLOCRECORD = "CM_ALLOCRECORD"; 306 PCSZ PCSZ_QUERYCNRINFO = "CM_QUERYCNRINFO"; 306 307 PCSZ PCSZ_DOSCREATEMUTEXSEM = "DosCreateMutexSem"; 307 308 PCSZ PCSZ_DOSCREATEEVENTSEM = "DosCreateEventSem"; … … 543 544 VOID APIENTRY DeInitFM3DLL(ULONG why) 544 545 { 545 / * cleanup */546 // cleanup 546 547 static CHAR s[CCHMAXPATH]; 547 548 CHAR *enddir, szTempFile[CCHMAXPATH]; … … 639 640 BOOL InitFM3DLL(HAB hab, int argc, char **argv) 640 641 { 641 /* 642 /** 642 643 * this function should be called by any application using this DLL right 643 644 * after setting up a message queue … … 714 715 strcpy(profile, PCSZ_FM3DOTINI); 715 716 mypid = getpid(); 716 / * give default appname if none set by caller */717 // give default appname if none set by caller 717 718 if (!*appname) 718 719 strcpy(appname, FM3Str); 719 / * save appname; may be reset below */720 // save appname; may be reset below 720 721 strcpy(realappname, appname); 721 722 if (!strcmp(appname, FM3Str)) … … 844 845 priority_bumped(); 845 846 846 / * _heapmin() is done in a separate thread -- start it */847 // _heapmin() is done in a separate thread -- start it 847 848 if (xbeginthread(HeapThread, 848 849 32768, … … 853 854 } 854 855 855 / * timer messages are sent from a separate thread -- start it */856 // timer messages are sent from a separate thread -- start it 856 857 if (!StartTimer()) { 857 858 Runtime_Error(pszSrcFile, __LINE__, … … 860 861 } 861 862 862 / * Are we the workplace shell? */863 // Are we the workplace shell? 863 864 env = getenv("WORKPLACE_PROCESS"); 864 865 fWorkPlace = env != NULL && … … 957 958 strcpy(appname, FM3Str); 958 959 959 / * start help */960 // start help 960 961 memset(&hini, 0, sizeof(HELPINIT)); 961 962 hini.cb = sizeof(HELPINIT); 962 // hini.ulReturnCode = 0;963 // hini.pszTutorialName = NULL;964 963 hini.phtHelpTable = (PHELPTABLE) MAKELONG(ID_HELPTABLE, 0xffff); 965 964 hini.hmodAccelActionBarModule = (HMODULE) 0; 966 // hini.idAccelTable = 0;967 // hini.idActionBar = 0;968 965 hini.pszHelpWindowTitle = (PSZ)GetPString(IDS_FM2HELPTITLETEXT); 969 966 hini.hmodHelpTableModule = FM3ModHandle; … … 1015 1012 } 1016 1013 1017 / * register window classes we use */1014 // register window classes we use 1018 1015 WinRegisterClass(hab, 1019 1016 (CHAR *) WC_MAINWND, … … 1616 1613 LoadDetailsSwitches(PCSZ_DIRCNR, &dsDirCnrDefault, FALSE); 1617 1614 1618 / * load pointers and icons we use */1615 // load pointers and icons we use 1619 1616 hptrArrow = WinQuerySysPointer(HWND_DESKTOP, SPTR_ARROW, FALSE); 1620 1617 hptrBusy = WinQuerySysPointer(HWND_DESKTOP, SPTR_WAIT, FALSE); … … 1765 1762 } 1766 1763 } 1767 DosClose(handle); / * Either way, we're done for now */1768 return ret; / * Return TRUE if matched */1764 DosClose(handle); // Either way, we're done for now 1765 return ret; // Return TRUE if matched 1769 1766 } 1770 1767 -
trunk/dll/init.h
r1664 r1673 109 109 extern PCSZ FNT_8TIMESNEWROMAN; 110 110 extern PCSZ PCSZ_CM_ALLOCRECORD; 111 extern PCSZ PCSZ_QUERYCNRINFO; 111 112 extern PCSZ PCSZ_DOSCREATEMUTEXSEM; 112 113 extern PCSZ PCSZ_DOSCREATEEVENTSEM; -
trunk/dll/literal.c
r1438 r1673 41 41 static INT index(const CHAR * s, const CHAR c); 42 42 43 /* Get index of char in string 43 /** 44 * Get index of char in string 44 45 * @parm s string to search 45 46 * @parm c char to search for … … 57 58 } 58 59 59 /* literal() 60 /** 61 * literal() 60 62 * Translate a string with \ escape tokens to binary equivalent 61 63 * Translates in place … … 103 105 return 0; 104 106 105 iBuf = 0; / * set index to first character */107 iBuf = 0; // set index to first character 106 108 while (pszBuf[iBuf]) { 107 109 switch (pszBuf[iBuf]) { 108 110 case '\\': 109 111 switch (pszBuf[iBuf + 1]) { 110 case 'x': / * hexadecimal */112 case 'x': // hexadecimal 111 113 wchar = 0; 112 iBuf += 2; / * get past "\x" */114 iBuf += 2; // get past "\x" 113 115 if (index(HEX, (CHAR) toupper(pszBuf[iBuf])) != -1) { 114 116 iBufSave = iBuf; … … 120 122 } 121 123 else 122 wchar = 'x'; / * just an x */124 wchar = 'x'; // just an x 123 125 iBuf--; 124 126 *pszOut++ = wchar; 125 127 break; 126 128 127 case '\\': / * we want a "\" */129 case '\\': // we want a "\" 128 130 iBuf++; 129 131 *pszOut++ = '\\'; 130 132 break; 131 133 132 case 't': / * tab CHAR */134 case 't': // tab CHAR 133 135 iBuf++; 134 136 *pszOut++ = '\t'; 135 137 break; 136 138 137 case 'n': / * new line */139 case 'n': // new line 138 140 iBuf++; 139 141 *pszOut++ = '\n'; 140 142 break; 141 143 142 case 'r': / * carr return */144 case 'r': // carr return 143 145 iBuf++; 144 146 *pszOut++ = '\r'; 145 147 break; 146 148 147 case 'b': / * back space */149 case 'b': // back space 148 150 iBuf++; 149 151 *pszOut++ = '\b'; 150 152 break; 151 153 152 case 'f': / * formfeed */154 case 'f': // formfeed 153 155 iBuf++; 154 156 *pszOut++ = '\x0c'; 155 157 break; 156 158 157 case 'a': / * bell */159 case 'a': // bell 158 160 iBuf++; 159 161 *pszOut++ = '\07'; 160 162 break; 161 163 162 case '\'': / * single quote */164 case '\'': // single quote 163 165 iBuf++; 164 166 *pszOut++ = '\''; 165 167 break; 166 168 167 case '\"': / * double quote */169 case '\"': // double quote 168 170 169 171 iBuf++; … … 171 173 break; 172 174 173 default: / * decimal */174 iBuf++; / * get past "\" */175 default: // decimal 176 iBuf++; // get past "\" 175 177 wchar = 0; 176 178 if (index(DEC, pszBuf[iBuf]) != -1) { 177 179 iBufSave = iBuf; 178 do { / * cvt to binary */180 do { // cvt to binary 179 181 wchar = (CHAR) (wchar * 10 + (pszBuf[iBuf++] - 48)); 180 182 } while (index(DEC, pszBuf[iBuf]) != -1 && iBuf < iBufSave + 3); … … 194 196 iBuf++; 195 197 } // while 196 *pszOut = 0; / * Always terminate, even if not string */197 198 cBufBytes = pszOut - pszWork; / * Calc string length excluding terminator */199 memcpy(pszBuf, pszWork, cBufBytes + 1); / * Overwrite including terminator */198 *pszOut = 0; // Always terminate, even if not string 199 200 cBufBytes = pszOut - pszWork; // Calc string length excluding terminator 201 memcpy(pszBuf, pszWork, cBufBytes + 1); // Overwrite including terminator 200 202 free(pszWork); 201 203 202 return cBufBytes; / * Return string length */204 return cBufBytes; // Return string length 203 205 } 204 206 -
trunk/dll/loadbmp.c
r1544 r1673 96 96 } 97 97 98 /* Read bitmap info header 99 Allocate enough to hold a complete 2.x bitmap array file header 100 fixme to support > 256 colors? 98 /** 99 * Read bitmap info header 100 * Allocate enough to hold a complete 2.x bitmap array file header 101 * fixme to support > 256 colors? 101 102 */ 102 103 pbmafh2 = … … 104 105 if (!pbmafh2) 105 106 goto ExitLoadBMP; 106 /* Assign pointers to the file header and bitmap info header etc. 107 Both the 1.x and 2.x structures are assigned to simplify code 108 fixme to clean this up - aliased pointers are evil 107 /** 108 * Assign pointers to the file header and bitmap info header etc. 109 * Both the 1.x and 2.x structures are assigned to simplify code 110 * fixme to clean this up - aliased pointers are evil 109 111 */ 110 112 pbmfh2 = &pbmafh2->bfh2; … … 119 121 case BFT_COLORPOINTER: 120 122 { 121 /* Assume image is a 2.0 image and read as a 2.x header 122 OK for 1.x file - read will not fail unless file is corrupted 123 /** 124 * Assume image is a 2.0 image and read as a 2.x header 125 * OK for 1.x file - read will not fail unless file is corrupted 123 126 */ 124 127 rc = fseek(pf, 0, SEEK_SET); … … 135 138 136 139 is2x = pbmih2->cbFix > sizeof(BITMAPINFOHEADER); // 1.x or 2.x bitmap 137 /* We will read the color table later 138 Color table follows header but 139 location depends on the type of the bitmap (old vs new) 140 1.x header is fixed size 141 2.x header is variable sized, so offset must be calculated 142 cbFix contains actual size of BITMAPINFOHEADER2 in file 140 /** 141 * We will read the color table later 142 * Color table follows header but 143 * location depends on the type of the bitmap (old vs new) 144 * 1.x header is fixed size 145 * 2.x header is variable sized, so offset must be calculated 146 * cbFix contains actual size of BITMAPINFOHEADER2 in file 143 147 */ 144 148 ulRGBOffset = is2x ? sizeof(*pbmfh2) - sizeof(*pbmih2) + pbmih2->cbFix : … … 149 153 case BFT_BITMAPARRAY: 150 154 { 151 /* Now we are dealing with a bitmap array which is a collection of bitmaps 152 Each bitmap has its own file header 155 /** 156 * Now we are dealing with a bitmap array which is a collection of bitmaps 157 * Each bitmap has its own file header 153 158 */ 154 159 … … 163 168 HDC hdc; 164 169 165 /* Scan the array and chose the bitmap best suited 166 for the current display size and color capacities 170 /** 171 * Scan the array and chose the bitmap best suited 172 * for the current display size and color capacities 167 173 */ 168 174 hdc = GpiQueryDevice(hPS); … … 233 239 234 240 is2x = pbmih2->cbFix > sizeof(BITMAPINFOHEADER); 235 /* As before, we calculate offset in file stream to color table 236 This code must match single bitmap logic 241 /** 242 * As before, we calculate offset in file stream to color table 243 * This code must match single bitmap logic 237 244 */ 238 245 ulRGBOffset = ulOffsetPicked; … … 257 264 // Read color table 258 265 if (is2x) { 259 /* For a 2.0 bitmap, read the color table as is 260 The bitmap info structure is header + color table 261 If we have 24 bits per pel, there is usually no color table, unless 262 pbmih2->cclrUsed or pbmih2->cclrImportant are non zero 263 fixme to test this 266 /** 267 * For a 2.0 bitmap, read the color table as is 268 * The bitmap info structure is header + color table 269 * If we have 24 bits per pel, there is usually no color table, unless 270 * pbmih2->cclrUsed or pbmih2->cclrImportant are non zero 271 * fixme to test this 264 272 */ 265 273 if (pbmih2->cBitCount < 24) { … … 284 292 } 285 293 else { 286 /* This is a 1.x format bitmap 287 Since the current standard format is the 2.0 288 convert the header and color table to 2.x format 294 /** 295 * This is a 1.x format bitmap 296 * Since the current standard format is the 2.0 297 * convert the header and color table to 2.x format 289 298 */ 290 299 ULONG ul; … … 319 328 } // if 1.x 320 329 321 /* The 2.0 bitmap info structure set up 322 Position to start of the bitmap data 330 /** 331 * The 2.0 bitmap info structure set up 332 * Position to start of the bitmap data 323 333 */ 324 334 rc = fseek(pf, pbmfh2->offBits, SEEK_SET); … … 328 338 } 329 339 330 /* Read the bitmap data 331 The read size is derived using the magic formula 332 Each bitmap scan line is aligned on a doubleword boundary 333 The size of the scan line is the number of pels times the bpp 334 After aligning it, we divide by 4 to get the number of bytes, and 335 multiply by the number of scan lines and the number of pel planes 340 /** 341 * Read the bitmap data 342 * The read size is derived using the magic formula 343 * Each bitmap scan line is aligned on a doubleword boundary 344 * The size of the scan line is the number of pels times the bpp 345 * After aligning it, we divide by 4 to get the number of bytes, and 346 * multiply by the number of scan lines and the number of pel planes 336 347 */ 337 348 if (pbmi2->ulCompression) -
trunk/dll/mainwnd.c
r1672 r1673 262 262 case UM_SETUP4: 263 263 case UM_SETUP5: 264 /* 265 * feed setup messages to main window 266 */ 264 // feed setup messages to main window 267 265 PostMsg(hwndMain, msg, mp1, mp2); 268 266 return 0; 269 267 270 268 case UM_SETUP6: 271 /* 272 * handle bubble help requests from drive bar buttons 273 */ 269 // handle bubble help requests from drive bar buttons 274 270 { 275 271 char dv[3], d; … … 365 361 366 362 case UM_NOTIFY: 367 /* 368 * bring up notify messages for various windows 369 */ 363 // bring up notify messages for various windows 370 364 if (mp1) 371 365 return MRFROMLONG(DoNotify((char *)mp1)); … … 600 594 noattrib &= (~(SWP_SHOW | SWP_ZORDER)); 601 595 noattrib |= SWP_HIDE; 602 / * count tools */596 // count tools 603 597 tool = toolhead; 604 598 for (numtools = 0L; tool; numtools++) 605 599 tool = tool->next; 606 / * allocate swp array for WinSetMultWindowPos */600 // allocate swp array for WinSetMultWindowPos 607 601 swp = xmallocz(sizeof(SWP) * (numtools + 2), pszSrcFile, __LINE__); 608 602 if (swp) { … … 995 989 hwndActive = WinQueryActiveWindow(HWND_DESKTOP); 996 990 if (hwndActive) { 997 / * don't bring up help if window isn't active */991 // don't bring up help if window isn't active 998 992 if (!WinIsChild(hwnd, hwndActive)) 999 993 return; … … 1001 995 hwndActive = WinQueryFocus(HWND_DESKTOP); 1002 996 if (WinQueryClassName(hwndActive, sizeof(ucClassname), ucClassname)) { 1003 / * don't bring up help if a menu is active */997 // don't bring up help if a menu is active 1004 998 if (!strcmp(ucClassname, "#4")) 1005 999 return; … … 1343 1337 break; 1344 1338 1345 case IDM_HIDEANYTOOL: / * hide any tool */1346 case IDM_HIDETOOL: / * hide tool */1339 case IDM_HIDEANYTOOL: // hide any tool 1340 case IDM_HIDETOOL: // hide tool 1347 1341 if (SHORT1FROMMP(mp1) == IDM_HIDETOOL) 1348 1342 id = WinQueryWindowUShort(hwnd, QWS_ID); … … 1360 1354 break; 1361 1355 1362 case IDM_SHOWTOOLS: / * show all tools */1356 case IDM_SHOWTOOLS: // show all tools 1363 1357 tool = toolhead; 1364 1358 while (tool) { … … 1369 1363 break; 1370 1364 1371 case IDM_DELETEANYTOOL: / * delete any button */1372 case IDM_DELETETOOL: / * delete button */1365 case IDM_DELETEANYTOOL: // delete any button 1366 case IDM_DELETETOOL: // delete button 1373 1367 if (SHORT1FROMMP(mp1) == IDM_DELETETOOL) 1374 1368 id = WinQueryWindowUShort(hwnd, QWS_ID); … … 1382 1376 return 0; 1383 1377 1384 case IDM_EDITANYTOOL: / * edit any button */1385 case IDM_EDITTOOL: / * edit button */1378 case IDM_EDITANYTOOL: // edit any button 1379 case IDM_EDITTOOL: // edit button 1386 1380 if (SHORT1FROMMP(mp1) == IDM_EDITTOOL) 1387 1381 id = WinQueryWindowUShort(hwnd, QWS_ID); … … 1404 1398 break; 1405 1399 1406 case IDM_ADDTOOL: / * add tool */1400 case IDM_ADDTOOL: // add tool 1407 1401 id = (USHORT) WinDlgBox(HWND_DESKTOP, hwnd, AddToolProc, FM3ModHandle, 1408 1402 ADDBTN_FRAME, MPVOID); … … 1415 1409 break; 1416 1410 1417 case IDM_REORDERTOOLS: / * reorder tools */1411 case IDM_REORDERTOOLS: // reorder tools 1418 1412 WinDlgBox(HWND_DESKTOP, 1419 1413 hwnd, ReOrderToolsProc, FM3ModHandle, RE_FRAME, MPVOID); … … 1443 1437 1444 1438 case WM_CONTEXTMENU: 1445 //DosEnterCritSec(); //GKY 11-29-081446 1439 DosRequestMutexSem(hmtxFM2Globals, SEM_INDEFINITE_WAIT); 1447 1440 if (!hwndMenu) 1448 1441 hwndMenu = WinLoadMenu(hwnd, FM3ModHandle, ID_BUTTONMENU); 1449 1442 DosReleaseMutexSem(hmtxFM2Globals); 1450 //DosExitCritSec();1451 1443 //fixme to allow user to change font 1-10-09 GKY 1452 1444 SetPresParams(hwndMenu, NULL, NULL, NULL, FNT_10SYSTEMPROPORT); … … 1457 1449 case DM_DRAGOVER: 1458 1450 { 1459 PDRAGINFO pDInfo; / * Pointer to DRAGINFO */1460 1461 pDInfo = (PDRAGINFO) mp1; / * Get DRAGINFO pointer */1462 DrgAccessDraginfo(pDInfo); / * Access DRAGINFO */1451 PDRAGINFO pDInfo; // Pointer to DRAGINFO 1452 1453 pDInfo = (PDRAGINFO) mp1; // Get DRAGINFO pointer 1454 DrgAccessDraginfo(pDInfo); // Access DRAGINFO 1463 1455 id = WinQueryWindowUShort(hwnd, QWS_ID); 1464 1456 tool = find_tool(id); 1465 1457 if (!tool) { 1466 1458 DrgFreeDraginfo(pDInfo); 1467 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); / * Drop not valid */1459 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); // Drop not valid 1468 1460 } 1469 1461 if (!(tool->flags & T_DROPABLE)) { 1470 1462 DrgFreeDraginfo(pDInfo); 1471 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); / * Drop not valid */1463 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); // Drop not valid 1472 1464 } 1473 1465 { 1474 PDRAGITEM pDItem; / * Pointer to DRAGITEM */1475 1476 pDItem = DrgQueryDragitemPtr(pDInfo, / * Access DRAGITEM */1477 0); / * Index to DRAGITEM */1478 if (DrgVerifyRMF(pDItem, /* Check valid rendering */1479 (CHAR *) DRM_OS2FILE, /* mechanisms and data */1480 NULL)) { /* formats */1466 PDRAGITEM pDItem; // Pointer to DRAGITEM 1467 1468 pDItem = DrgQueryDragitemPtr(pDInfo, // Access DRAGITEM 1469 0); // Index to DRAGITEM 1470 if (DrgVerifyRMF(pDItem, // Check valid rendering 1471 (CHAR *) DRM_OS2FILE, // mechanisms and data 1472 NULL)) { // formats 1481 1473 if (!(tool->flags & T_EMPHASIZED)) { 1482 1474 tool->flags |= T_EMPHASIZED; … … 1484 1476 DrgFreeDraginfo(pDInfo); 1485 1477 } 1486 return (MRFROM2SHORT(DOR_DROP, / * Return okay to drop */1487 DO_MOVE)); / * Move operation valid */1478 return (MRFROM2SHORT(DOR_DROP, // Return okay to drop 1479 DO_MOVE)); // Move operation valid 1488 1480 } 1489 1481 DrgFreeDraginfo(pDInfo); 1490 1482 } 1491 1483 } 1492 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); / * Drop not valid */1484 return (MRFROM2SHORT(DOR_NEVERDROP, 0)); // Drop not valid 1493 1485 1494 1486 case DM_DROPHELP: … … 2292 2284 WinEnableMenuItem(hwndMenu, IDM_CHKDSK, FALSE); 2293 2285 } 2294 /* fixme to be gone?2295 if (!rdy || ~driveflags[iDrv] & DRIVE_CDROM) {2296 WinEnableMenuItem(hwndMenu, IDM_CLOSETRAY, FALSE);2297 }2298 */2299 2286 PopupMenu(hwnd, hwnd, hwndMenu); 2300 2287 } … … 2982 2969 return 0; 2983 2970 2984 case UM_SETUP2: / * Used to load a new a toolbar */2971 case UM_SETUP2: // Used to load a new a toolbar 2985 2972 BuildTools(hwnd, TRUE); 2986 2973 return 0; … … 3199 3186 BOOL CloseDirCnrChildren(HWND hwndClient) 3200 3187 { 3201 / * returns TRUE if a directory container window was told to close */3188 // returns TRUE if a directory container window was told to close 3202 3189 3203 3190 HENUM henum; … … 3680 3667 if (ulCnt == (ULONG) - 1) { 3681 3668 ulCnt = CountChildren(hwndClient, &ulNumMinChildren); 3682 / * return these values to the caller for later use */3669 // return these values to the caller for later use 3683 3670 *ulCntR = ulCnt; 3684 3671 *ulNumMinChildrenR = ulNumMinChildren; … … 3897 3884 SHORT newcx, SHORT newcy) 3898 3885 { 3899 /* 3886 /** 3900 3887 * resize all children of the client to maintain their proportional 3901 3888 * sizes and positions … … 4237 4224 mr = oldproc(hwnd, msg, mp1, mp2); 4238 4225 4239 /* 4226 /** 4240 4227 * Calculate the position of the client rectangle. 4241 4228 * Otherwise, we'll see a lot of redraw when we move the … … 4316 4303 soldCount = sCount; 4317 4304 4318 /* 4305 /** 4319 4306 * Reformat the frame to "squeeze" the client 4320 4307 * and make room for status window sibling beneath … … 5660 5647 hwndFrame = WinQueryWindow(hwnd, QW_PARENT); 5661 5648 5662 /* 5663 * create frame children (not client children, frame children) 5664 */ 5649 // create frame children (not client children, frame children) 5665 5650 DosSleep(1); 5666 5651 WinQueryWindowPos(hwndFrame, &swp); … … 5932 5917 5933 5918 case UM_SETUP: 5934 /* 5935 * start up some initial children 5936 */ 5919 // start up some initial children 5937 5920 WinShowWindow(WinQueryWindow(hwnd, QW_PARENT), TRUE); 5938 5921 PostMsg(MainObjectHwnd, UM_SETUP2, mp1, mp2); … … 5994 5977 5995 5978 case UM_SETUP3: 5996 / * start remaining child windows */5979 // start remaining child windows 5997 5980 if (!fNoSaveState && fSaveState) { 5998 5981 PCSZ pszStatename = PCSZ_SHUTDOWNSTATE; … … 6190 6173 6191 6174 case IDM_WINDOWSMENU: 6192 /* 6175 /** 6193 6176 * add child windows of client 6194 6177 * and switchlist entries to end of pulldown menu … … 6641 6624 6642 6625 case UM_SETDIR: 6643 / * mp1 == name of directory to open */6626 // mp1 == name of directory to open 6644 6627 if (mp1) 6645 6628 return MRFROMLONG(OpenDirCnr((HWND) 0, -
trunk/dll/mainwnd2.c
r1670 r1673 181 181 PFNWPFrame(hwnd, msg, mp1, mp2); 182 182 183 /* 183 /** 184 184 * Calculate the position of the client rectangle. 185 185 * Otherwise, we'll see a lot of redraw when we move the … … 241 241 PFNWPFrame(hwnd, msg, mp1, mp2)); 242 242 soldCount = sCount; 243 /* 243 /** 244 244 * Reformat the frame to "squeeze" the client 245 245 * and make room for status window sibling beneath … … 819 819 PFNWP oldproc; 820 820 821 /* 822 * create frame children (not client children, frame children) 823 */ 821 // create frame children (not client children, frame children) 824 822 DosSleep(1); 825 823 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp); … … 1282 1280 return 0; 1283 1281 } 1284 / * intentional fallthru */1282 // intentional fallthru 1285 1283 case WM_SIZE: 1286 1284 pd = WinQueryWindowPtr(hwnd, QWL_USER + 4); -
trunk/dll/makelist.c
r1570 r1673 44 44 VOID SortList(LISTINFO *li) 45 45 { 46 / * bubble-sort entries by size, descending */46 // bubble-sort entries by size, descending 47 47 48 48 UINT x; -
trunk/dll/menu.c
r1544 r1673 114 114 info->type = SEPARATOR; 115 115 else { 116 / * error! */116 // error! 117 117 xfree(info->text, pszSrcFile, __LINE__); 118 118 free(info); -
trunk/dll/misc.c
r1647 r1673 118 118 #include "info.h" // driveflags 119 119 120 #define CONTAINER_COLUMNS 13 / * Number of columns in details view */120 #define CONTAINER_COLUMNS 13 // Number of columns in details view 121 121 #define MS_POPUP 0x00000010L 122 122 … … 302 302 void PaintSTextWindow(HWND hwnd, HPS hps) 303 303 { 304 /* 304 /** 305 305 * paint a text window such that the rightmost part of the text is 306 306 * always visible even if the text length exceeds the length of the … … 364 364 VOID PaintRecessedWindow(HWND hwnd, HPS hps, BOOL outtie, BOOL dbl) 365 365 { 366 /* 366 /** 367 367 * paint a recessed box around the window 368 368 * two pixels width required around window for painting... … … 947 947 strchr(szData, '*') || IsRoot(pci->pszFileName)) 948 948 return (MRESULT) FALSE; 949 / * If the text changed, rename the file system object. */949 // If the text changed, rename the file system object. 950 950 chop_at_crnl(szData); 951 951 bstrip(szData); … … 969 969 if (stricmp(szData, testname) && IsFile(testname) != -1) { 970 970 if (!fAlertBeepOff) 971 DosBeep(50, 100); /* exists; disallow */972 return (MRESULT) FALSE; 971 DosBeep(50, 100); 972 return (MRESULT) FALSE; // exists; disallow 973 973 } 974 974 if (fVerify && (driveflags[toupper(*szData) - 'A'] & DRIVE_WRITEVERIFYOFF || … … 1296 1296 VOID FcloseFile(FILE * fp) 1297 1297 { 1298 / * for use by apps that don't use the DLLs runtime library */1298 // for use by apps that don't use the DLLs runtime library 1299 1299 fclose(fp); 1300 1300 } … … 1684 1684 MPFROMLONG(CMA_FIRST), 1685 1685 MPFROMSHORT(attrib)); 1686 if ((!pmi || (INT) pmi == -1) && attrib == CRA_SELECTED) / * punt */1686 if ((!pmi || (INT) pmi == -1) && attrib == CRA_SELECTED) // punt 1687 1687 attrib = CRA_CURSORED; 1688 1688 else … … 1899 1899 HWND CheckMenu(HWND hwnd, HWND * hwndMenu, USHORT id) 1900 1900 { 1901 / * load and adjust menus as required */1901 // load and adjust menus as required 1902 1902 if (!*hwndMenu || !WinIsWindow((HAB) 0, *hwndMenu)) { 1903 1903 *hwndMenu = WinLoadMenu(HWND_DESKTOP, FM3ModHandle, id); … … 2301 2301 void SetupWinList(HWND hwndMenu, HWND hwndTop, HWND hwndFrame) 2302 2302 { 2303 /* 2303 /** 2304 2304 * add switchlist entries to end of pulldown menu 2305 2305 */ … … 2311 2311 MM_QUERYITEMCOUNT, MPVOID, MPVOID); 2312 2312 2313 / * clean out old additions */2313 // clean out old additions 2314 2314 while ((SHORT) WinSendMsg(hwndMenu, 2315 2315 MM_DELETEITEM, … … 2331 2331 HWND hwndChild; 2332 2332 2333 / * add children of the main FM/2 client */2333 // add children of the main FM/2 client 2334 2334 henum = WinBeginEnumWindows(hwndTop); 2335 2335 memset(&mi, 0, sizeof(mi)); … … 2355 2355 } 2356 2356 2357 / * add external FM/2 windows */2357 // add external FM/2 windows 2358 2358 { 2359 2359 PSWBLOCK pswb; … … 2363 2363 2364 2364 hwndTopFrame = hwndTop ? WinQueryWindow(hwndTop, QW_PARENT) : (HWND)0; 2365 / * Get the switch list information */2365 // Get the switch list information 2366 2366 x = 0; 2367 2367 ulcEntries = WinQuerySwitchList(0, NULL, 0); 2368 2368 ulSize = sizeof(SWBLOCK) + sizeof(HSWITCH) + (ulcEntries + 4L) * 2369 2369 (LONG) sizeof(SWENTRY); 2370 / * Allocate memory for list */2370 // Allocate memory for list 2371 2371 pswb = xmalloc(ulSize, pszSrcFile, __LINE__); 2372 2372 if (pswb) { 2373 / * Put the info in the list */2373 // Put the info in the list 2374 2374 ulcEntries = WinQuerySwitchList(0, pswb, ulSize - sizeof(SWENTRY)); 2375 / * do the dirty deed */2375 // do the dirty deed 2376 2376 memset(&mi, 0, sizeof(mi)); 2377 2377 for (i = 0; i < pswb->cswentry; i++) { … … 2420 2420 2421 2421 if (hwndMain && hwndMenu && cmd >= IDM_WINDOWSTART && cmd < IDM_SWITCHSTART) { 2422 /* 2423 * select a child window (of client) 2424 */ 2422 // select a child window (of client) 2425 2423 2426 2424 MENUITEM mi; -
trunk/dll/mkdir.c
r1545 r1673 91 91 { 92 92 93 /* 93 /** 94 94 * bitmapped flags: 95 95 * 1 = don't ask to create if non-existent -
trunk/dll/mle.c
r1628 r1673 71 71 ((c) - (char) 0xd):(c) 72 72 73 /*((FAKEROT==0)?(c):(FAKEROT==1)?(!isalpha((c)))?(c):((((c) >= (char) 'A') && \74 ((c) <= (char) 'M')) || (((c) >= (char) 'a') && ((c) <= (char) 'm')))?((c) + (char) 0xd)\75 :((((c) >= (char) 'N') && ((c) <= (char) 'Z')) || (((c) >= (char) 'n') && ((c) <= (char) 'z')))?\76 ((c) - (char) 0xd):(c):((c) >= (char) '!') ? ((((c) + (char) 47) > (char) '~') ? ((c) - (char) 47) :\77 ((c) + (char) 47)) : (c))*/78 79 73 LONG MLEgetlinetext(HWND h, LONG l, CHAR * buf, INT maxlen) 80 74 { 81 / * get text of line l from MLE */75 // get text of line l from MLE 82 76 83 77 IPT s, e; … … 90 84 LONG MLEdeleteline(HWND h, LONG l) 91 85 { 92 / * delete line l from MLE */86 // delete line l from MLE 93 87 94 88 IPT s, e; … … 101 95 LONG MLEdeletecurline(HWND h) 102 96 { 103 / * delete current line from MLE */97 // delete current line from MLE 104 98 105 99 LONG l; … … 111 105 LONG MLEdeletetoeol(HWND h) 112 106 { 113 / * delete from cursor pos to end of line */107 // delete from cursor pos to end of line 114 108 115 109 IPT s, e; … … 122 116 VOID MLEclearall(HWND h) 123 117 { 124 / * remove all text from MLE */118 // remove all text from MLE 125 119 LONG len; 126 120 … … 132 126 LONG MLEtextatcursor(HWND h, CHAR * buffer, INT buflen) 133 127 { 134 /* place up to buflen chars of text from cursor pos into buffer 128 /** 129 * place up to buflen chars of text from cursor pos into buffer 135 130 * return # of chars imported 136 131 */ … … 144 139 LONG MLEtextatpos(HWND h, IPT i, CHAR * buffer, INT buflen) 145 140 { 146 /* place up to buflen chars of text from pos i in buffer 141 /** 142 * place up to buflen chars of text from pos i in buffer 147 143 * return # of chars imported 148 144 */ … … 156 152 LONG MLEsizeofsel(HWND h) 157 153 { 158 / * return length of selected text */154 // return length of selected text 159 155 160 156 IPT cursor, anchor, test; … … 163 159 anchor = MLEancpos(h); 164 160 test = min(cursor, anchor); 165 / * MLE fakes us out; get real length in bytes */161 // MLE fakes us out; get real length in bytes 166 162 return (LONG) WinSendMsg(h, MLM_QUERYFORMATTEXTLENGTH, 167 163 MPFROMLONG(test), … … 247 243 BOOL MLEdoblock(HWND h, INT action, CHAR * filename) 248 244 { 249 / * perform action on text in selection */245 // perform action on text in selection 250 246 251 247 register CHAR *p; … … 396 392 break; 397 393 398 default: / * unknown action */394 default: // unknown action 399 395 #ifdef __DEBUG_ALLOC__ 400 396 _heap_check(); … … 410 406 } 411 407 412 / * replace selection with altered text */408 // replace selection with altered text 413 409 p = sel; 414 410 here = min(curpos, ancpos); 415 MLEclear(h); / * delete current selection */416 sellen = oldlen = strlen(sel); / * actual number of bytes */411 MLEclear(h); // delete current selection 412 sellen = oldlen = strlen(sel); // actual number of bytes 417 413 while (oldlen > 0) { 418 414 sellen = min(oldlen, 32700); … … 428 424 p += sellen; 429 425 oldlen -= sellen; 430 if (oldlen && *p == '\n' /* && *(p - 1) == '\r' */)426 if (oldlen && *p == '\n') 431 427 p--; 432 428 } // while … … 498 494 BOOL MLEHexLoad(HWND h, CHAR * filename) 499 495 { 500 / * insert a file into the current position in the MLE */496 // insert a file into the current position in the MLE 501 497 502 498 HAB hab; … … 550 546 numimport = CreateHexDump(buffer, 551 547 numread, hexbuff, 50000, left, TRUE); 552 while (len && numimport) { / * import entire file */548 while (len && numimport) { // import entire file 553 549 left += numread; 554 550 len -= numread; … … 664 660 if (numread < 1) 665 661 ret = FALSE; 666 while (len && numread > 0) { / * here we go... */662 while (len && numread > 0) { // here we go... 667 663 668 664 CHAR s[81]; 669 665 670 while (numread > 0) { / * import entire file */666 while (numread > 0) { // import entire file 671 667 if (!WinIsWindow(hab, h) || (vw && vw->killme)) 672 668 break; … … 822 818 INT hex) 823 819 { 824 /* load a file into the MLE in the background (via a separate thread) 820 /** 821 * load a file into the MLE in the background (via a separate thread) 825 822 * return _beginthread status 826 823 */ … … 846 843 BOOL MLEloadfile(HWND h, CHAR * filename) 847 844 { 848 /* load a file into the MLE, getting rid of whatever was already 845 /** 846 * load a file into the MLE, getting rid of whatever was already 849 847 * there. Note this returns without erasing existing text if the 850 848 * file to load does not exist … … 867 865 BOOL striptraillines, BOOL striptrailspaces) 868 866 { 869 /* save the MLE contents as a file. Format the output so that 867 /** 868 * save the MLE contents as a file. Format the output so that 870 869 * the file is CR/LF terminated as presented in the MLE. 871 870 */ … … 879 878 CHAR *mode; 880 879 881 if (!MLEgetlen(h)) / * nothing to save; forget it */880 if (!MLEgetlen(h)) // nothing to save; forget it 882 881 return TRUE; 883 882 … … 897 896 } 898 897 if (!MLEgetlen(h)) { 899 / * nothing to save; forget it */898 // nothing to save; forget it 900 899 MLEsetwrap(h, fWrap); // Restore 901 900 return TRUE; … … 989 988 MRESULT EXPENTRY SandRDlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 990 989 { 991 / * initiate search(/replace)s in edit mode */990 // initiate search(/replace)s in edit mode 992 991 993 992 SRCHPTR *vw; -
trunk/dll/newview.c
r1544 r1673 453 453 while (*e != '\r' && *e != '\n' && e < ad->text + ad->textsize) 454 454 e++; 455 /* fixme to be gone?456 if((*e == '\r' || *e == '\n') && e > p)457 e--;458 */459 455 width = e - p; 460 456 } … … 1327 1323 whereiam = NULL; 1328 1324 } 1329 / * assign ad->lines[ad->numlines] */1325 // assign ad->lines[ad->numlines] 1330 1326 if (ad->numlines + 1 > ad->numalloc) { 1331 1327 … … 1343 1339 ad->numlines++; 1344 1340 if (ad->numlines == numlines) { 1345 / * display first page */1341 // display first page 1346 1342 register INT x; 1347 1343 … … 1570 1566 mr = oldproc(hwnd, msg, mp1, mp2); 1571 1567 1572 /* 1568 /** 1573 1569 * Calculate the position of the client rectangle. 1574 1570 * Otherwise, we'll see a lot of redraw when we move the … … 1598 1594 soldCount = sCount; 1599 1595 1600 /* 1596 /** 1601 1597 * Reformat the frame to "squeeze" the client 1602 1598 * and make room for status window sibling beneath -
trunk/dll/notebook.c
r1664 r1673 3543 3543 MPFROMLONG(CMA_FLWINDOWATTR)); 3544 3544 } 3545 / * intentional fallthru */3545 // intentional fallthru 3546 3546 case CFG9_1X: 3547 3547 if (SHORT1FROMMP(mp1) == CFG9_1X) { … … 4015 4015 break; 4016 4016 4017 case IDM_HELP: / * relay message to appropriate page's window */4017 case IDM_HELP: // relay message to appropriate page's window 4018 4018 ulPageId = (ULONG) WinSendDlgItemMsg(hwnd, 4019 4019 CFG_NOTEBOOK, -
trunk/dll/objcnr.c
r1438 r1673 161 161 pciP->rc.hptrIcon = hptr; 162 162 163 if (!pciP->rc.hptrIcon || pciP->rc.hptrIcon == hptrFile) / * OS/2 bug bug bug bug */163 if (!pciP->rc.hptrIcon || pciP->rc.hptrIcon == hptrFile) // OS/2 bug bug bug bug 164 164 pciP->rc.hptrIcon = hptrDir; 165 165 -
trunk/dll/objwin.c
r1498 r1673 92 92 # endif 93 93 WinSetWindowPtr(ObjectHwnd, QWL_USER, args); 94 / * initially populate container */94 // initially populate container 95 95 // 18 Jul 08 SHL fixme to know if this really kills WM_CREATE 96 96 WinSendMsg(ObjectHwnd, UM_SETUP, MPVOID, MPVOID); -
trunk/dll/presparm.c
r1409 r1673 37 37 38 38 #ifdef NEVER 39 /* 39 /** 40 40 * this routine will fill a buffer with all defined window pres params 41 41 * the PRESPARAMS structure returned is suitable to be passed as … … 49 49 if (!tagname || !*tagname || !prof) 50 50 return; 51 / * setup memory access */51 // setup memory access 52 52 ppresparams = (PRESPARAMS *) xmalloc(PP_MAXBUF, pszSrcFile, __LINE__); 53 53 if (!ppresparams) 54 54 return; 55 ppresparams->cb = 0; /* no entries yet */ 56 pparam = ppresparams->aparam; /* cast structure onto memory */ 57 58 /* 59 * query every possible presentation parameter... 60 */ 61 62 /* foreground color -- takes 12 bytes */ 55 ppresparams->cb = 0; // no entries yet 56 pparam = ppresparams->aparam; // cast structure onto memory 57 58 // query every possible presentation parameter... 59 60 // foreground color -- takes 12 bytes 63 61 pparam->cb = WinQueryPresParam(hwnd, 64 62 PP_FOREGROUNDCOLOR, … … 67 65 sizeof(LONG), 68 66 (PVOID) pparam->ab, QPF_NOINHERIT); 69 if (pparam->cb) { /* was the param found? */70 ppresparams->cb += 12; /* used 12 bytes */71 pparam = (PPARAM) (((ULONG) pparam) + 12); / * advance 12 bytes to next memory location */72 } 73 74 / * background color -- takes 12 bytes */67 if (pparam->cb) { // was the param found? 68 ppresparams->cb += 12; // used 12 bytes 69 pparam = (PPARAM) (((ULONG) pparam) + 12); // advance 12 bytes to next memory location 70 } 71 72 // background color -- takes 12 bytes 75 73 pparam->cb = WinQueryPresParam(hwnd, 76 74 PP_BACKGROUNDCOLOR, … … 84 82 } 85 83 86 / * hilited foreground color -- takes 12 bytes */84 // hilited foreground color -- takes 12 bytes 87 85 pparam->cb = WinQueryPresParam(hwnd, 88 86 PP_HILITEFOREGROUNDCOLOR, … … 96 94 } 97 95 98 / * hilited background color -- takes 12 bytes */96 // hilited background color -- takes 12 bytes 99 97 pparam->cb = WinQueryPresParam(hwnd, 100 98 PP_HILITEBACKGROUNDCOLOR, … … 108 106 } 109 107 110 / * disabled foreground color -- takes 12 bytes */108 // disabled foreground color -- takes 12 bytes 111 109 pparam->cb = WinQueryPresParam(hwnd, 112 110 PP_DISABLEDFOREGROUNDCOLOR, … … 120 118 } 121 119 122 / * disabled background color -- takes 12 bytes */120 // disabled background color -- takes 12 bytes 123 121 pparam->cb = WinQueryPresParam(hwnd, 124 122 PP_DISABLEDBACKGROUNDCOLOR, … … 132 130 } 133 131 134 / * border color -- takes 12 bytes */132 // border color -- takes 12 bytes 135 133 pparam->cb = WinQueryPresParam(hwnd, 136 134 PP_BORDERCOLOR, … … 144 142 } 145 143 146 / * font name & size -- maximum 44 bytes (32 for face name, 4 for point size) + 8 for data */144 // font name & size -- maximum 44 bytes (32 for face name, 4 for point size) + 8 for data 147 145 pparam->cb = WinQueryPresParam(hwnd, 148 146 PP_FONTNAMESIZE, … … 155 153 } 156 154 157 / * active color -- takes 12 bytes */155 // active color -- takes 12 bytes 158 156 pparam->cb = WinQueryPresParam(hwnd, 159 157 PP_ACTIVECOLOR, … … 167 165 } 168 166 169 / * inactive color -- takes 12 bytes */167 // inactive color -- takes 12 bytes 170 168 pparam->cb = WinQueryPresParam(hwnd, 171 169 PP_INACTIVECOLOR, … … 179 177 } 180 178 181 / * active text foreground color -- takes 12 bytes */179 // active text foreground color -- takes 12 bytes 182 180 pparam->cb = WinQueryPresParam(hwnd, 183 181 PP_ACTIVETEXTFGNDCOLOR, … … 192 190 } 193 191 194 / * active text background color -- takes 12 bytes */192 // active text background color -- takes 12 bytes 195 193 pparam->cb = WinQueryPresParam(hwnd, 196 194 PP_ACTIVETEXTBGNDCOLOR, … … 205 203 } 206 204 207 / * inactive text foreground color -- takes 12 bytes */205 // inactive text foreground color -- takes 12 bytes 208 206 pparam->cb = WinQueryPresParam(hwnd, 209 207 PP_INACTIVETEXTFGNDCOLOR, … … 218 216 } 219 217 220 / * inactive text background color -- takes 12 bytes */218 // inactive text background color -- takes 12 bytes 221 219 pparam->cb = WinQueryPresParam(hwnd, 222 220 PP_INACTIVETEXTBGNDCOLOR, … … 231 229 } 232 230 233 / * shadow color -- takes 12 bytes */231 // shadow color -- takes 12 bytes 234 232 pparam->cb = WinQueryPresParam(hwnd, 235 233 PP_SHADOW, 0, … … 242 240 } 243 241 244 / * menu foreground color -- takes 12 bytes */242 // menu foreground color -- takes 12 bytes 245 243 pparam->cb = WinQueryPresParam(hwnd, 246 244 PP_MENUFOREGROUNDCOLOR, … … 254 252 } 255 253 256 / * menu background color -- takes 12 bytes */254 // menu background color -- takes 12 bytes 257 255 pparam->cb = WinQueryPresParam(hwnd, 258 256 PP_MENUBACKGROUNDCOLOR, … … 266 264 } 267 265 268 / * menu hilite foreground color -- takes 12 bytes */266 // menu hilite foreground color -- takes 12 bytes 269 267 pparam->cb = WinQueryPresParam(hwnd, 270 268 PP_MENUHILITEFGNDCOLOR, … … 278 276 } 279 277 280 / * menu hilite background color -- takes 12 bytes */278 // menu hilite background color -- takes 12 bytes 281 279 pparam->cb = WinQueryPresParam(hwnd, 282 280 PP_MENUHILITEBGNDCOLOR, … … 290 288 } 291 289 292 / * menu disabled foreground color -- takes 12 bytes */290 // menu disabled foreground color -- takes 12 bytes 293 291 pparam->cb = WinQueryPresParam(hwnd, 294 292 PP_MENUDISABLEDFGNDCOLOR, … … 302 300 } 303 301 304 / * menu disabled background color -- takes 12 bytes */302 // menu disabled background color -- takes 12 bytes 305 303 pparam->cb = WinQueryPresParam(hwnd, 306 304 PP_MENUDISABLEDBGNDCOLOR, … … 325 323 VOID CopyPresParams(HWND target, HWND source) 326 324 { 327 /* 325 /** 328 326 * Copy presentation parameters of interest to us from one window 329 327 * to another -
trunk/dll/printer.c
r1544 r1673 83 83 CHAR *modea = "a+"; 84 84 85 if (!fWorkPlace) / * assume spooler is active */85 if (!fWorkPlace) // assume spooler is active 86 86 return TRUE; 87 87 DosError(FERR_DISABLEHARDERR); … … 104 104 } 105 105 fclose(printhandle); 106 if (data & 32) / * bit 5 is out of paper */106 if (data & 32) // bit 5 is out of paper 107 107 return FALSE; 108 108 return TRUE; -
trunk/dll/remap.c
r1544 r1673 81 81 VOID load_resources(VOID) 82 82 { 83 / * load linked list of resources from RESOURCE.DAT file */83 // load linked list of resources from RESOURCE.DAT file 84 84 85 85 FILE *fp; … … 120 120 VOID save_resources(VOID) 121 121 { 122 / * save linked list of resources to RESOURCE.DAT file */122 // save linked list of resources to RESOURCE.DAT file 123 123 124 124 LINKRES *info; … … 364 364 while (info) { 365 365 if (info->happ == (HAPP) mp1) { 366 /* Note: if this next line is removed, FM/2 will start the attach/detach 367 * request again, once for each request, to see if it might succeed and to 368 * ensure the request is seen by the user in case interaction is required. 369 */ 366 /** 367 * Note: if this next line is removed, FM/2 will start the attach/detach 368 * request again, once for each request, to see if it might succeed and to 369 * ensure the request is seen by the user in case interaction is required. 370 */ 370 371 info->failedonce = TRUE; 371 372 hwndList = WinWindowFromID(hwnd, -
trunk/dll/saveclip.c
r1628 r1673 853 853 FILE_HIDDEN | FILE_SYSTEM, 854 854 &ffb4, sizeof(ffb4), &nm, FIL_QUERYEASIZEL)) { 855 / * load the object's Subject, if required */855 // load the object's Subject, if required 856 856 if (ffb4.cbList > 4) { 857 857 APIRET rc; … … 894 894 } 895 895 } 896 / * load the object's longname */896 // load the object's longname 897 897 if (ffb4.cbList > 4) { 898 898 APIRET rc; -
trunk/dll/seeall.c
r1664 r1673 524 524 break; 525 525 } 526 if (!WinDlgBox(HWND_DESKTOP, hwndFrame, ArchiveDlgProc, FM3ModHandle, ARCH_FRAME, (PVOID) & ad) || !*ad.arcname || !*ad.command) { /* we blew it */ 526 if (!WinDlgBox(HWND_DESKTOP, hwndFrame, ArchiveDlgProc, FM3ModHandle, ARCH_FRAME, (PVOID) & ad) || 527 !*ad.arcname || !*ad.command) { // we blew it 527 528 FreeList(list); 528 529 break; … … 622 623 goto RetryPath; 623 624 } 624 / * intentional fallthru */625 // intentional fallthru 625 626 case IDM_RENAME: 626 627 { … … 756 757 } 757 758 if (plen) { 758 / * make directory/ies, if required */759 // make directory/ies, if required 759 760 760 761 CHAR dirpart[CCHMAXPATH]; … … 1439 1440 static BOOL Mark(HWND hwnd, INT command, CHAR ** list) 1440 1441 { 1441 / * Marks only unfiltered files */1442 // Marks only unfiltered files 1442 1443 1443 1444 ALLDATA *pAD = WinQueryWindowPtr(hwnd, QWL_USER); … … 1500 1501 static BOOL UpdateList(HWND hwnd, CHAR **list) 1501 1502 { 1502 / * Updates files in the list */1503 // Updates files in the list 1503 1504 1504 1505 ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER); … … 2494 2495 mr = oldproc(hwnd, msg, mp1, mp2); 2495 2496 2496 /* 2497 /** 2497 2498 * Calculate the position of the client rectangle. 2498 2499 * Otherwise, we'll see a lot of redraw when we move the … … 2515 2516 sCount = (SHORT) oldproc(hwnd, msg, mp1, mp2); 2516 2517 2517 /* 2518 /** 2518 2519 * Reformat the frame to "squeeze" the client 2519 2520 * and make room for status window sibling beneath … … 3534 3535 for (x = pAD->topfile - 1; x < pAD->afindexcnt; x++) { 3535 3536 ptl.x = pAD->horzscroll; 3536 if (wascursored) { / * reestablish normal colors */3537 if (wascursored) { // reestablish normal colors 3537 3538 GpiSetColor(pAD->hps, 3538 3539 standardcolors[Colors[COLORS_NORMALFORE]]); -
trunk/dll/select.c
r1604 r1673 743 743 cmp = TestCDates(&bsres->pci->date, &bsres->pci->time, 744 744 &Cnrs[z].ss[x].pci->date, &Cnrs[z].ss[x].pci->time); 745 /*(Cnrs[z].ss[x].pci->date.year >746 bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year <747 bsres->pci->date.748 year) ? FALSE : (Cnrs[z].749 ss[x].pci->750 date.month >751 bsres->pci->752 date.753 month) ? TRUE754 : (Cnrs[z].ss[x].pci->date.month <755 bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.756 day >757 bsres->pci->date.758 day) ? TRUE : (Cnrs[z].759 ss[x].pci->760 date.day <761 bsres->762 pci->date.763 day) ?764 FALSE : (Cnrs[z].ss[x].pci->time.hours >765 bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->766 time.hours <767 bsres->pci->time.768 hours) ? FALSE769 : (Cnrs[z].ss[x].pci->time.minutes >770 bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.771 minutes <772 bsres->pci->time.773 minutes) ? FALSE774 : (Cnrs[z].ss[x].pci->time.seconds >775 bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.776 seconds <777 bsres->pci->time.778 seconds) ? FALSE : FALSE;*/779 745 if (cmp != 1) 780 746 Cnrs[z].ss[x].newest = FALSE; 781 /*cmp =782 (Cnrs[z].ss[x].pci->date.year <783 bsres->pci->date.year) ? TRUE : (Cnrs[z].ss[x].pci->date.year >784 bsres->pci->date.785 year) ? FALSE : (Cnrs[z].786 ss[x].pci->787 date.month <788 bsres->pci->789 date.790 month) ? TRUE791 : (Cnrs[z].ss[x].pci->date.month >792 bsres->pci->date.month) ? FALSE : (Cnrs[z].ss[x].pci->date.793 day <794 bsres->pci->date.795 day) ? TRUE : (Cnrs[z].796 ss[x].pci->797 date.day >798 bsres->799 pci->date.800 day) ?801 FALSE : (Cnrs[z].ss[x].pci->time.hours <802 bsres->pci->time.hours) ? TRUE : (Cnrs[z].ss[x].pci->803 time.hours >804 bsres->pci->time.805 hours) ? FALSE806 : (Cnrs[z].ss[x].pci->time.minutes <807 bsres->pci->time.minutes) ? TRUE : (Cnrs[z].ss[x].pci->time.808 minutes >809 bsres->pci->time.810 minutes) ? FALSE811 : (Cnrs[z].ss[x].pci->time.seconds <812 bsres->pci->time.seconds) ? TRUE : (Cnrs[z].ss[x].pci->time.813 seconds >814 bsres->pci->time.815 seconds) ? FALSE : FALSE;*/816 747 if (cmp != -1) 817 748 Cnrs[z].ss[x].oldest = FALSE; -
trunk/dll/shadow.c
r1498 r1673 153 153 "SHADOWID=%s%s%s", 154 154 (path) ? path : NullStr, (path) ? PCSZ_BACKSLASH : NullStr, objtitle); 155 { / * find an icon for it if possible */155 { // find an icon for it if possible 156 156 CHAR *p, temp[CCHMAXPATH + 1]; 157 157 … … 262 262 if ((fsa.attrFile & FILE_DIRECTORY) || Shadows) 263 263 CreateShadowObject(p, (obj) ? szBuffer : NULL, szDir, 0, cnr); 264 else if (!(apt & (FAPPTYP_NOTWINDOWCOMPAT | FAPPTYP_WINDOWCOMPAT | FAPPTYP_WINDOWAPI | FAPPTYP_BOUND | FAPPTYP_DOS | FAPPTYP_WINDOWSREAL | FAPPTYP_WINDOWSPROT | 0x1000))) /* not an executable app? */ 264 else if (!(apt & (FAPPTYP_NOTWINDOWCOMPAT | FAPPTYP_WINDOWCOMPAT | FAPPTYP_WINDOWAPI | 265 FAPPTYP_BOUND | FAPPTYP_DOS | FAPPTYP_WINDOWSREAL | 266 FAPPTYP_WINDOWSPROT | 0x1000))) // not an executable app? 265 267 CreateDataObject(p, (obj) ? szBuffer : NULL, szDir, cnr); 266 268 else … … 282 284 filename[strlen(filename) - 1] == '>') || IsFile(filename) != -1) { 283 285 hWPSObject = WinQueryObject(filename); 284 if (hWPSObject != NULLHANDLE) { / * got something; try to to open it */286 if (hWPSObject != NULLHANDLE) { // got something; try to to open it 285 287 286 288 CHAR s[CCHMAXPATH]; -
trunk/dll/sortcnr.c
r1501 r1673 149 149 ret = TestCDates(&pCI1->date, &pCI1->time, 150 150 &pCI2->date, &pCI2->time); 151 /*(pCI1->date.year < pCI2->date.year) ? 1 :152 (pCI1->date.year > pCI2->date.year) ? -1 :153 (pCI1->date.month < pCI2->date.month) ? 1 :154 (pCI1->date.month > pCI2->date.month) ? -1 :155 (pCI1->date.day < pCI2->date.day) ? 1 :156 (pCI1->date.day > pCI2->date.day) ? -1 :157 (pCI1->time.hours < pCI2->time.hours) ? 1 :158 (pCI1->time.hours > pCI2->time.hours) ? -1 :159 (pCI1->time.minutes < pCI2->time.minutes) ? 1 :160 (pCI1->time.minutes > pCI2->time.minutes) ? -1 :161 (pCI1->time.seconds < pCI2->time.seconds) ? 1 :162 (pCI1->time.seconds > pCI2->time.seconds) ? -1 : 0;*/163 151 break; 164 152 … … 166 154 ret = TestCDates(&pCI1->ladate, &pCI1->latime, 167 155 &pCI2->ladate, &pCI2->latime); 168 /*(pCI1->ladate.year < pCI2->ladate.year) ? 1 :169 (pCI1->ladate.year > pCI2->ladate.year) ? -1 :170 (pCI1->ladate.month < pCI2->ladate.month) ? 1 :171 (pCI1->ladate.month > pCI2->ladate.month) ? -1 :172 (pCI1->ladate.day < pCI2->ladate.day) ? 1 :173 (pCI1->ladate.day > pCI2->ladate.day) ? -1 :174 (pCI1->latime.hours < pCI2->latime.hours) ? 1 :175 (pCI1->latime.hours > pCI2->latime.hours) ? -1 :176 (pCI1->latime.minutes < pCI2->latime.minutes) ? 1 :177 (pCI1->latime.minutes > pCI2->latime.minutes) ? -1 :178 (pCI1->latime.seconds < pCI2->latime.seconds) ? 1 :179 (pCI1->latime.seconds > pCI2->latime.seconds) ? -1 : 0;*/180 156 break; 181 157 … … 183 159 ret = TestCDates(&pCI1->crdate, &pCI1->crtime, 184 160 &pCI2->crdate, &pCI2->crtime); 185 /*(pCI1->crdate.year < pCI2->crdate.year) ? 1 :186 (pCI1->crdate.year > pCI2->crdate.year) ? -1 :187 (pCI1->crdate.month < pCI2->crdate.month) ? 1 :188 (pCI1->crdate.month > pCI2->crdate.month) ? -1 :189 (pCI1->crdate.day < pCI2->crdate.day) ? 1 :190 (pCI1->crdate.day > pCI2->crdate.day) ? -1 :191 (pCI1->crtime.hours < pCI2->crtime.hours) ? 1 :192 (pCI1->crtime.hours > pCI2->crtime.hours) ? -1 :193 (pCI1->crtime.minutes < pCI2->crtime.minutes) ? 1 :194 (pCI1->crtime.minutes > pCI2->crtime.minutes) ? -1 :195 (pCI1->crtime.seconds < pCI2->crtime.seconds) ? 1 :196 (pCI1->crtime.seconds > pCI2->crtime.seconds) ? -1 : 0;*/197 161 break; 198 162 } -
trunk/dll/srchpath.c
r1498 r1673 89 89 *p = 0; 90 90 p++; 91 if (*ret == '.') { / * skip initial "cur dir" */91 if (*ret == '.') { // skip initial "cur dir" 92 92 pp = strchr(p, ';'); 93 93 if (pp) -
trunk/dll/stristr.c
r1348 r1673 20 20 #include "stristr.h" 21 21 22 // static CHAR *strnistr(register CHAR * t, CHAR * s, LONG len);23 24 22 CHAR *stristr(const register CHAR * t, const CHAR * s) 25 // CHAR *stristr(register CHAR * t, CHAR * s)26 23 { 27 / * case-insensitive strstr() */24 // case-insensitive strstr() 28 25 29 26 const register CHAR *t1, *s1; … … 50 47 CHAR *strnistr(register CHAR * t, CHAR * s, LONG len) 51 48 { 52 / * case-insensitive strnstr() */49 // case-insensitive strnstr() 53 50 54 51 register CHAR *s1; … … 76 73 CHAR *strnstr(register CHAR * t, CHAR * s, LONG len) 77 74 { 78 /* strnstr() */79 80 75 register CHAR *s1; 81 76 register LONG len2; -
trunk/dll/sysinfo.c
r1554 r1673 140 140 WinDefDlgProc(hwnd, WM_SETICON, MPFROMLONG(hptrIcon), MPVOID); 141 141 { 142 static CHAR *names[] = { "Max. Path Length", / * 1 */143 "Max. Text Sessions", /* 2 */144 "Max. PM Sessions", /* 3 */145 "Max. VDM Sessions", /* 4 */146 "Boot Drive", /* 5 */147 "Dynamic Priority", /* 6 */148 "Max. Wait", /* 7 */149 "Min. Timeslice", /* 8 */150 "Max. Timeslice", /* 9 */151 "Page Size", /* 10 */152 "Version Major", /* 11 */153 "Version Minor", /* 12 */154 "Version Revision", /* 13 */155 "Millisecs Up", /* 14 */156 "Unixtime Low", /* 15 */157 "Unixtime High", /* 16 */158 "Physical Memory", /* 17 */159 "Resident Memory", /* 18 */160 "Total Available Memory", /* 19 */161 "Max. Private Memory", /* 20 */162 "Max. Shared Memory", /* 21 */163 "Timer Interval", /* 22 */164 "Max. Path Comp. Length", /* 23 */165 "Foreground FS Session ID" , /* 24 */166 "Foreground Process PID", /* 25 */142 static CHAR *names[] = { "Max. Path Length", // 1 143 "Max. Text Sessions", // 2 144 "Max. PM Sessions", // 3 145 "Max. VDM Sessions", // 4 146 "Boot Drive", // 5 147 "Dynamic Priority", // 6 148 "Max. Wait", // 7 149 "Min. Timeslice", // 8 150 "Max. Timeslice", // 9 151 "Page Size", // 10 152 "Version Major", // 11 153 "Version Minor", // 12 154 "Version Revision", // 13 155 "Millisecs Up", // 14 156 "Unixtime Low", // 15 157 "Unixtime High", // 16 158 "Physical Memory", // 17 159 "Resident Memory", // 18 160 "Total Available Memory", // 19 161 "Max. Private Memory", // 20 162 "Max. Shared Memory", // 21 163 "Timer Interval", // 22 164 "Max. Path Comp. Length", // 23 165 "Foreground FS Session ID"// 24 166 "Foreground Process PID", // 25 167 167 NULL 168 168 }; -
trunk/dll/systemf.c
r1628 r1673 159 159 PSZ *list, PCSZ prompt, PCSZ pszCallingFile, UINT uiLineNumber) 160 160 { 161 / * executes the command once for all files in list */161 // executes the command once for all files in list 162 162 163 163 CHAR path[CCHMAXPATH], *commandline, modpath[CCHMAXPATH], listfile[CCHMAXPATH], … … 252 252 if (*p == '%') { 253 253 switch (*(p + 1)) { 254 case '!': / * write list to file, add filename */254 case '!': // write list to file, add filename 255 255 if (list) { 256 256 if (!*listfile) { … … 279 279 break; 280 280 281 case 'c': / * add name of command processor */281 case 'c': // add name of command processor 282 282 { 283 283 char *env = GetCmdSpec(FALSE); … … 300 300 break; 301 301 302 case 't': / * add Target directory */302 case 't': // add Target directory 303 303 if (needs_quoting(targetdir) && !strchr(targetdir, '\"')) { 304 304 *pp = '\"'; … … 317 317 break; 318 318 319 case '$': / * add drive letter */319 case '$': // add drive letter 320 320 if (drive) 321 321 *pp = drive; … … 330 330 break; 331 331 332 case 'U': / * add path of first list component */332 case 'U': // add path of first list component 333 333 case 'u': 334 334 if (*modpath) { … … 382 382 break; 383 383 384 case 'P': / * add path of execution */384 case 'P': // add path of execution 385 385 case 'p': 386 386 if (*path) { … … 672 672 strcpy(ex.environment, environment); 673 673 if (flags & PROMPT) { 674 / * allow editing command line */674 // allow editing command line 675 675 ex.flags = (flags & (~PROMPT)); 676 676 ex.commandline = commandline; … … 687 687 else 688 688 ex.flags = flags; 689 //ex.flags &= (~PROMPT); redundant GKY 1-9-10690 689 //DbgMsg(pszSrcFile, __LINE__, "Inserted %s", environment); 691 690 ret = runemf2(ex.flags, hwnd, pszCallingFile, uiLineNumber, path, … … 706 705 { 707 706 /** example: 708 707 * 709 708 * status = runemf2(SEPARATE | WINDOWED, 710 709 * hwnd, pszCallingFile, __LINE__, … … 718 717 * pszCallingFile and __LINE__ are used to determine caller for easier error tracking 719 718 */ 720 721 /** 719 /** 722 720 * type bitmapped flag -- see systemf.h 723 721 */ … … 804 802 if (*pszPgm) { 805 803 if (*pszPgm == '<' && strchr(pszPgm, '>')) { 806 / * is a workplace object */804 // is a workplace object 807 805 HOBJECT hWPSObject; 808 806 char temp; … … 820 818 pszArgs = NULL; 821 819 *p = 0; 822 / * Find the handle of the WPS object */820 // Find the handle of the WPS object 823 821 hWPSObject = WinQueryObject(pszPgm); 824 822 *p = temp; … … 873 871 else 874 872 p = pszPgm; 875 p[strlen(p) + 1] = 0; / * double-terminate args */873 p[strlen(p) + 1] = 0; // double-terminate args 876 874 if (*pszPgm) { 877 875 if (!strchr(pszPgm, '\\') && … … 1115 1113 type |= FULLSCREEN; 1116 1114 } 1117 else / * ? */1115 else // ? 1118 1116 ulAppType = SSF_TYPE_WINDOWABLEVIO; 1119 1117 } -
trunk/dll/tools.c
r1544 r1673 764 764 istext = FALSE; 765 765 tool = INSTDATA(hwnd); 766 if (tool) { / * just editing strings... */766 if (tool) { // just editing strings... 767 767 istext = ((tool->flags & T_TEXT) != 0); 768 768 xfree(tool->help, pszSrcFile, __LINE__); -
trunk/dll/treecnr.c
r1663 r1673 265 265 BOOL maketop) 266 266 { 267 /* Find a record in tree view, move it so it shows in container and 268 make it the current record */ 267 /** 268 * Find a record in tree view, move it so it shows in container and 269 * make it the current record 270 */ 269 271 270 272 PCNRITEM pci, pciToSelect, pciP; … … 341 343 } // while 342 344 } 343 / * expand all parent branches */345 // expand all parent branches 344 346 pciToSelect = pci; 345 347 for (;;) { … … 358 360 } // for 359 361 } 360 / * make record visible */362 // make record visible 361 363 MakeTop: 362 364 pciToSelect = pci; … … 471 473 mr = CommonFrameWndProc(TREE_CNR, hwnd, msg, mp1, mp2); 472 474 473 /* 475 /** 474 476 * Calculate the position of the client rectangle. 475 477 * Otherwise, we'll see a lot of redraw when we move the … … 492 494 sCount = (SHORT) CommonFrameWndProc(TREE_CNR, hwnd, msg, mp1, mp2); 493 495 494 /* 495 * Reformat the frame to "squeeze" the client 496 */ 496 // Reformat the frame to "squeeze" the client 497 497 498 498 pswp = (PSWP) mp1; … … 843 843 } 844 844 else { 845 / * find root record and strip it */845 // find root record and strip it 846 846 pci = FindParentRecord(dcd->hwndCnr, pci); 847 847 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; … … 857 857 858 858 case UM_RESCAN: 859 /* 860 * populate container 861 */ 859 // populate container 862 860 DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT); 863 861 DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); … … 1188 1186 1189 1187 if (dcd && dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) { 1190 /* 1191 * put name of our window on status line 1192 */ 1188 // put name of our window on status line 1193 1189 1194 1190 PCNRITEM pci = NULL; … … 1262 1258 else { 1263 1259 if (!dcd->hwndObject) { 1264 /* 1265 * first time through -- set things up 1266 */ 1260 // first time through -- set things up 1267 1261 CNRINFO cnri; 1268 1262 … … 1461 1455 Win_Error(hwnd, hwnd, pszSrcFile, __LINE__, 1462 1456 PCSZ_DRGACCESSDRAGINFO); 1463 return (MRFROM2SHORT(DOR_NODROP, 0)); / * Drop not valid */1457 return (MRFROM2SHORT(DOR_NODROP, 0)); // Drop not valid 1464 1458 } 1465 1459 pci = (PCNRITEM) ((PCNRDRAGINFO) mp2)->pRecord; … … 1503 1497 } 1504 1498 } 1505 pDItem = DrgQueryDragitemPtr(pDInfo, /* Access DRAGITEM */ 1506 0); /* Index to DRAGITEM */ 1507 if (DrgVerifyRMF(pDItem, /* Check valid rendering */ 1508 (CHAR *) DRM_OS2FILE, /* mechanisms and data */ 1509 NULL) || DrgVerifyRMF(pDItem, (CHAR *) DRM_FM2ARCMEMBER, 1510 (CHAR *) DRF_FM2ARCHIVE)) { /* formats */ 1511 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO */ 1499 pDItem = DrgQueryDragitemPtr(pDInfo, // Access DRAGITEM 1500 0); // Index to DRAGITEM 1501 if (DrgVerifyRMF(pDItem, // Check valid rendering 1502 (CHAR *) DRM_OS2FILE, // mechanisms and data 1503 NULL) || DrgVerifyRMF(pDItem, 1504 (CHAR *) DRM_FM2ARCMEMBER, 1505 (CHAR *) DRF_FM2ARCHIVE)) { // formats 1506 DrgFreeDraginfo(pDInfo); // Free DRAGINFO 1512 1507 if (!pci || (INT) pci == -1) 1513 1508 return MRFROM2SHORT(DOR_DROP, DO_MOVE); … … 1517 1512 if (toupper(*pci->pszFileName) < 'C') 1518 1513 return MRFROM2SHORT(DOR_DROP, DO_COPY); 1519 return MRFROM2SHORT(DOR_DROP, /* Return okay to drop */1514 return MRFROM2SHORT(DOR_DROP, // Return okay to drop 1520 1515 ((fCopyDefault) ? DO_COPY : DO_MOVE)); 1521 1516 } 1522 DrgFreeDraginfo(pDInfo); /* Free DRAGINFO */1523 } 1524 return MRFROM2SHORT(DOR_NODROP, 0); /* Drop not valid */1517 DrgFreeDraginfo(pDInfo); // Free DRAGINFO 1518 } 1519 return MRFROM2SHORT(DOR_NODROP, 0); // Drop not valid 1525 1520 1526 1521 case CN_INITDRAG: … … 2917 2912 } 2918 2913 } 2919 / * else intentional fallthru */2914 // else intentional fallthru 2920 2915 case IDM_ATTRS: 2921 2916 case IDM_INFO: … … 3103 3098 dcd->stopflag++; 3104 3099 if (dcd && dcd->hwndObject) { 3105 / * kill object window */3100 // kill object window 3106 3101 if (WinIsWindow((HAB) 0, dcd->hwndObject)) { 3107 3102 if (!PostMsg(dcd->hwndObject, WM_CLOSE, MPVOID, MPVOID)) … … 3150 3145 HWND StartTreeCnr(HWND hwndParent, ULONG flags) 3151 3146 { 3152 /* bitmapped flags: 3147 /** 3148 * bitmapped flags: 3153 3149 * 0x00000001 = don't close app when window closes 3154 3150 * 0x00000002 = no frame controls -
trunk/dll/update.c
r1611 r1673 73 73 } 74 74 75 /* Update/add CNRITEM record for filename 75 /** 76 * Update/add CNRITEM record for filename 76 77 * Deletes existing CNRITEM if file has disappeared 77 78 * @returns pci pointer to CNRITEM record or NULL if not found or if stale CNRITEM deleted … … 92 93 if (IsFullName(filename)) { 93 94 if (driveflags[toupper(*filename) - 'A'] & DRIVE_NOTWRITEABLE) 94 / * ignore non-writeable drives */95 // ignore non-writeable drives 95 96 return (PCNRITEM) NULL; 96 97 } … … 102 103 &ffb, sizeof(ffb), &nm, FIL_QUERYEASIZEL); 103 104 if (!status) { 104 / * file exists */105 // file exists 105 106 DosFindClose(hDir); 106 107 if (!dcd) 107 108 dcd = INSTDATA(hwndCnr); 108 /*109 if(dcd->type == TREE_FRAME &&110 !(ffb.attrFile & FILE_DIRECTORY))111 return (PCNRITEM)NULL;112 */113 109 if (dcd->type == ARC_FRAME) 114 110 return (PCNRITEM) NULL; … … 167 163 MPFROMP(pci), MPFROM2SHORT(TRUE, oldemphasis)); 168 164 } 169 else / * existed, unchanged, do nothing but return */165 else // existed, unchanged, do nothing but return 170 166 return pci; 171 167 } … … 207 203 else if (ffb.attrFile & FILE_DIRECTORY) { 208 204 209 / * check all parts and insert as required */205 // check all parts and insert as required 210 206 CHAR *p, temp; 211 207 PCNRITEM pciParent = NULL, pciT; … … 359 355 if (IsFullName(filename[x])) { 360 356 if (driveflags[toupper(*filename[x]) - 'A'] & DRIVE_NOTWRITEABLE) 361 / * ignore non-writeable drives */357 // ignore non-writeable drives 362 358 continue; 363 359 } … … 370 366 &ffb, sizeof(ffb), &nm, FIL_QUERYEASIZEL); 371 367 if (!status) { 372 / * file exists */368 // file exists 373 369 DosFindClose(hDir); 374 // if(dcd->type == TREE_FRAME && !(ffb.attrFile & FILE_DIRECTORY))375 // continue;376 370 if (dcd->type == DIR_FRAME && *dcd->directory) { 377 371 … … 398 392 (PCNRITEM) NULL, partial, FALSE, TRUE); 399 393 if (pci) { 400 / * update record? */394 // update record? 401 395 if ((!fForceUpper && !fForceLower && 402 396 strcmp(pci->pszFileName, filename[x])) || … … 415 409 pci->latime.minutes != ffb.ftimeLastAccess.minutes || 416 410 pci->latime.hours != ffb.ftimeLastAccess.hours) { 417 / * changed; update */411 // changed; update 418 412 pciList[numlist++] = pci; 419 413 *ffb.achName = 0; … … 430 424 } 431 425 else { 432 / * add record */426 // add record 433 427 if (dcd->type == DIR_FRAME) { 434 428 RECORDINSERT ri; … … 470 464 } 471 465 else if (ffb.attrFile & FILE_DIRECTORY) { 472 / * check all parts and insert as required */466 // check all parts and insert as required 473 467 CHAR *p, temp; 474 468 PCNRITEM pciParent = NULL, pciT; … … 577 571 TRUE)) != NULL && 578 572 (INT) pci != -1 && !IsRoot(pci->pszFileName)) { 579 / * file doesn't exist; delete record */573 // file doesn't exist; delete record 580 574 if (pci->rc.flRecordAttr & CRA_SELECTED) 581 575 WinSendMsg(hwndCnr, -
trunk/dll/uudecode.c
r1544 r1673 47 47 static PSZ pszSrcFile = __FILE__; 48 48 49 / * prototypes */49 // prototypes 50 50 static BOOL decode(FILE * in, FILE * out); 51 51 static void outdec(char *p, FILE * f, int n); 52 52 53 / * single character decode */53 // single character decode 54 54 #define DEC(c) (((c) - ' ') & 077) 55 55 … … 73 73 } 74 74 75 / * search for header line */75 // search for header line 76 76 for (;;) { 77 77 if (!fgets(buf, sizeof(buf), in)) { … … 90 90 dest[CCHMAXPATH - 1] = 0; 91 91 { 92 / * place dest in same directory as filename by default... */92 // place dest in same directory as filename by default... 93 93 char build[CCHMAXPATH], *p; 94 94 … … 110 110 } 111 111 112 / * create output file */112 // create output file 113 113 moder = "ab+"; 114 114 out = xfsopen(dest, moder, SH_DENYWR, pszSrcFile, __LINE__, TRUE); … … 132 132 } 133 133 134 /* 134 /** 135 135 * copy from in to out, decoding as you go along. 136 136 */ … … 142 142 143 143 for (;;) { 144 / * for each input line */144 // for each input line 145 145 if (!xfgets(buf, sizeof(buf), in, pszSrcFile, __LINE__)) 146 146 return FALSE; … … 158 158 } 159 159 160 /* 160 /** 161 161 * output a group of 3 bytes (4 input characters). 162 162 * the input chars are pointed to by p, they are to -
trunk/dll/valid.c
r1672 r1673 92 92 APIRET MakeFullName(char *pszFileName) 93 93 { 94 / * pszFileName must be CCHMAXPATH long minimum! */94 // pszFileName must be CCHMAXPATH long minimum! 95 95 96 96 char szPathName[CCHMAXPATH]; … … 117 117 p = (p) ? (pp) ? (p > pp) ? p : pp : p : pp; 118 118 } 119 if (!p) / * name is itself a root */119 if (!p) // name is itself a root 120 120 p = filename; 121 else / * skip past backslash */121 else // skip past backslash 122 122 p++; 123 123 return p; … … 220 220 BOOL IsNewer(char *file1, char *file2) 221 221 { 222 / * return TRUE if file2 is newer than file1 */222 // return TRUE if file2 is newer than file1 223 223 224 224 return (TestFDates(file1, file2, NULL, NULL, NULL, NULL) > 0); … … 319 319 (PFSQBUFFER2) pvBuffer, &clBufferSize); 320 320 if (rc) { 321 / * can't get any info at all */321 // can't get any info at all 322 322 DosFreeMem(pvBuffer); 323 323 DosError(FERR_DISABLEHARDERR); … … 411 411 NonRemovable = 1; // Preset as non removable 412 412 DosError(FERR_DISABLEHARDERR); 413 rc = DosDevIOCtl(hDev, IOCTL_DISK, DSK_BLOCKREMOVABLE, &parmPkt.Cmd, /* Address of the command-specific argument list. */414 sizeof(parmPkt.Cmd), / * Length, in bytes, of pParams. */415 &clParmBytes, / * Pointer to the length of parameters. */416 &NonRemovable, / * Address of the data area. */417 sizeof(NonRemovable), /* Length, in bytes, of pData. */418 &clDataBytes); / * Pointer to the length of data. */413 rc = DosDevIOCtl(hDev, IOCTL_DISK, DSK_BLOCKREMOVABLE, &parmPkt.Cmd, // Address of the command-specific argument list. 414 sizeof(parmPkt.Cmd), // Length, in bytes, of pParams. 415 &clParmBytes, // Pointer to the length of parameters. 416 &NonRemovable, // Address of the data area. 417 sizeof(NonRemovable),// Length, in bytes, of pData. 418 &clDataBytes); // Pointer to the length of data. 419 419 420 420 if (!rc && NonRemovable) { … … 424 424 memset(&dataPkt, 0xff, sizeof(dataPkt)); 425 425 DosError(FERR_DISABLEHARDERR); 426 rc = DosDevIOCtl(hDev, IOCTL_DISK, DSK_GETDEVICEPARAMS, &parmPkt.Cmd, /* Address of the command-specific argument list. */427 sizeof(parmPkt.Cmd), / * Length, in bytes, of pParams. */428 &clParmBytes, /* Pointer to the length of parameters. */429 &dataPkt, /* Address of the data area. */430 sizeof(dataPkt), /* Length, in bytes, of pData. */431 &clDataBytes); /* Pointer to the length of data. */426 rc = DosDevIOCtl(hDev, IOCTL_DISK, DSK_GETDEVICEPARAMS, &parmPkt.Cmd,// Address of the command-specific argument list. 427 sizeof(parmPkt.Cmd), // Length, in bytes, of pParams. 428 &clParmBytes, // Pointer to the length of parameters. 429 &dataPkt, // Address of the data area. 430 sizeof(dataPkt), // Length, in bytes, of pData. 431 &clDataBytes); // Pointer to the length of data. 432 432 433 433 if (!rc && (dataPkt.bpb.fsDeviceAttr & BPB_REMOVABLE_MEDIA)) … … 448 448 BOOL IsFileSame(CHAR * filename1, CHAR * filename2) 449 449 { 450 / * returns: -1 (error), 0 (is a directory), or 1 (is a file) */450 // returns: -1 (error), 0 (is a directory), or 1 (is a file) 451 451 452 452 FILESTATUS3L fsa1, fsa2; … … 492 492 return 0; 493 493 } 494 return -1; / * error; doesn't exist or can't read or null filename */494 return -1; // error; doesn't exist or can't read or null filename 495 495 } 496 496 … … 1080 1080 *objectpath = 0; 1081 1081 if (OS2ver[0] > 20 || (OS2ver[0] == 20 && OS2ver[1] >= 30)) { 1082 /* 1082 /** 1083 1083 * if running under warp, we can get the desktop name 1084 1084 * this way... -
trunk/dll/viewer.c
r1544 r1673 78 78 { 79 79 80 /* 80 /** 81 81 * create an editor window 82 82 * bitmapped flags: … … 357 357 switch (msg) { 358 358 case WM_CREATE: 359 / * create MLE window */359 // create MLE window 360 360 if (!WinCreateWindow(hwnd, 361 361 WC_MLE, … … 460 460 vw->hab = WinQueryAnchorBlock(hwnd); 461 461 WinSendMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 462 / * set up initial MLE conditions */462 // set up initial MLE conditions 463 463 vw->srch.hwndmle = hwndMLE; 464 464 MLEsetcurpos(hwndMLE, 0); … … 609 609 return 0; 610 610 611 case UM_CONTAINER_FILLED: / * file was loaded */611 case UM_CONTAINER_FILLED: // file was loaded 612 612 WinEnableWindow(vw->hwndMenu, TRUE); 613 613 vw->busy = FALSE; … … 647 647 648 648 case UM_SELECT: 649 case WM_SETFOCUS: / * sling focus to MLE */649 case WM_SETFOCUS: // sling focus to MLE 650 650 if (mp2) { 651 651 if (hwndMain && fAutoView) … … 711 711 } 712 712 switch (SHORT1FROMMP(mp1)) { 713 /* 714 case MLE_PREVIEW: 715 preview_text(hwndMLE); 716 break; 717 */ 713 718 714 case MLE_VIEWFTP: 719 715 MLEinternet(hwndMLE, TRUE); … … 817 813 } 818 814 else { 819 / * I dunno why I gotta reset the colors... */815 // I dunno why I gotta reset the colors... 820 816 BOOL ro; 821 817 LONG fColor, bColor; … … 909 905 } 910 906 { 911 / * zero file length instead of unlink (protects EAs from loss) */907 // zero file length instead of unlink (protects EAs from loss) 912 908 FILE *fp; 913 909 CHAR *moder = "r+"; … … 952 948 break; 953 949 } 954 / * intentional fallthru */950 // intentional fallthru 955 951 case MLE_INSERTFILE: 956 952 if (!MLEgetreadonly(hwndMLE)) { … … 967 963 MLEinsertfile(hwndMLE, filename); 968 964 else { 969 // switch_to(filename);970 965 if (MLEbackgroundload(hwnd, 971 966 UM_CONTAINER_FILLED, … … 1117 1112 break; 1118 1113 1119 case MLE_CUTLINE: / * delete current line */1114 case MLE_CUTLINE: // delete current line 1120 1115 if (!MLEgetreadonly(hwndMLE)) 1121 1116 MLEdeletecurline(hwndMLE); … … 1128 1123 break; 1129 1124 1130 case DID_CANCEL: / * escape */1125 case DID_CANCEL: // escape 1131 1126 if (MLEgetreadonly(hwndMLE)) 1132 1127 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID); … … 1135 1130 break; 1136 1131 1137 case MLE_QUIT: / * outtahere */1132 case MLE_QUIT: // outtahere 1138 1133 MLEsetchanged(hwndMLE, FALSE); 1139 1134 vw->ch = FALSE; 1140 / * intentional fallthru */1135 // intentional fallthru 1141 1136 case MLE_END: 1142 1137 PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID); 1143 1138 break; 1144 1139 1145 case MLE_SETFONT: / * select a new font */1140 case MLE_SETFONT: // select a new font 1146 1141 SetMLEFont(hwndMLE, &vw->fattrs, 0); 1147 1142 PrfWriteProfileData(fmprof, … … 1184 1179 break; 1185 1180 1186 case MLE_FINDFIRST: / * search */1181 case MLE_FINDFIRST: // search 1187 1182 if (MLEfindfirst(hwnd, &vw->srch)) 1188 1183 PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(MLE_FINDNEXT, 0), MPVOID); … … 1202 1197 break; 1203 1198 1204 case MLE_TOGWRAP: / * toggle wrap mode */1199 case MLE_TOGWRAP: // toggle wrap mode 1205 1200 if (vw->hex != 1) { 1206 1201 SetMenuCheck(vw->hwndMenu, MLE_TOGWRAP, &vw->fWrap, TRUE, "MLEWrap"); … … 1231 1226 break; 1232 1227 1233 case WM_CLOSE: / * outtahere */1228 case WM_CLOSE: // outtahere 1234 1229 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID); 1235 1230 if (vw) { -
trunk/dll/viewinf.c
r1648 r1673 26 26 ***********************************************************************/ 27 27 28 /* offset 107: title of INF file */29 30 28 #include <stdlib.h> 31 29 #include <string.h> 32 30 #include <share.h> 33 // #include <process.h> // _beginthread34 31 35 32 #define INCL_DOS -
trunk/dll/walkem.c
r1670 r1673 372 372 VOID load_udirs(VOID) 373 373 { 374 / * load linked list of user directories from USERDIRS.DAT file */374 // load linked list of user directories from USERDIRS.DAT file 375 375 376 376 FILE *fp; … … 489 489 } 490 490 else { 491 / * if adding manual directory, remove from auto list if present */491 // if adding manual directory, remove from auto list if present 492 492 info = ldirhead; 493 493 temp = NULL; … … 645 645 BOOL nounwriteable) 646 646 { 647 /* 647 /** 648 648 * this function fills one or two list boxes with drive and directory 649 649 * information showing all available drives and all directories off of … … 741 741 CHAR szBuff[CCHMAXPATH + 1], szBuffer[CCHMAXPATH + 1], *p; 742 742 SHORT sSelect; 743 static BOOL okay; / * avoid combobox selecting as filled */743 static BOOL okay; // avoid combobox selecting as filled 744 744 static CHAR lastdir[CCHMAXPATH + 1]; 745 745 … … 821 821 if (!loadedudirs) 822 822 load_udirs(); 823 { / * fill user list box */823 { // fill user list box 824 824 ULONG ulDriveNum, ulDriveMap; 825 825 ULONG ulSearchCount; … … 1377 1377 CHAR szBuff[CCHMAXPATH + 1], szBuffer[CCHMAXPATH + 1], *p; 1378 1378 SHORT sSelect; 1379 static BOOL okay; / * avoid combobox selecting as filled */1379 static BOOL okay; // avoid combobox selecting as filled 1380 1380 1381 1381 switch (msg) { -
trunk/dll/winlist.c
r1400 r1673 86 86 register INT i, y; 87 87 88 / * Get the switch list information */88 // Get the switch list information 89 89 ulcEntries = WinQuerySwitchList(0, NULL, 0); 90 90 ulSize = sizeof(SWBLOCK) + sizeof(HSWITCH) + (ulcEntries + 4) * 91 91 (LONG) sizeof(SWENTRY); 92 / * Allocate memory for list */92 // Allocate memory for list 93 93 pswb = xmalloc((unsigned)ulSize, pszSrcFile, __LINE__); 94 94 if (pswb) { 95 / * Put the info in the list */95 // Put the info in the list 96 96 ulcEntries = WinQuerySwitchList(0, pswb, ulSize - sizeof(SWENTRY)); 97 / * do the dirty deed */97 // do the dirty deed 98 98 y = 0; 99 99 for (i = 0; i < pswb->cswentry; i++) { -
trunk/dll/worker.c
r1666 r1673 613 613 break; 614 614 } 615 / * else intentional fallthru */615 // else intentional fallthru 616 616 case IDM_OPENDEFAULT: 617 617 case IDM_OPENSETTINGS: … … 856 856 } 857 857 if (plen) { 858 / * make directory/ies, if required */858 // make directory/ies, if required 859 859 860 860 CHAR dirpart[CCHMAXPATH]; … … 1059 1059 GetPString(IDS_WPSCOPYTEXT) : 1060 1060 GetPString(IDS_RENAMETEXT), 1061 &"s"[x == 1], / * s or nul */1061 &"s"[x == 1], // s or nul 1062 1062 (wk->li->type == IDM_MOVE || 1063 1063 wk->li->type == IDM_COPY || … … 1157 1157 break; 1158 1158 } 1159 / * else intentional fallthru */1159 // else intentional fallthru 1160 1160 case IDM_UPDATE: 1161 1161 Broadcast(hab2, … … 1221 1221 } 1222 1222 } 1223 / * intentional fallthru */1223 // intentional fallthru 1224 1224 case IDM_FAKEEXTRACT: 1225 1225 case IDM_FAKEEXTRACTM: … … 1340 1340 if (*wk->li->targetpath && !IsFile(wk->li->targetpath)) 1341 1341 AddBackslashToPath(wk->li->targetpath); 1342 //if (wk->li->targetpath[strlen(wk->li->targetpath) - 1] !=1343 // '\\')1344 // strcat(wk->li->targetpath, "\\");1345 1342 ad.namecanchange = 1; 1346 1343 } … … 1355 1352 FM3ModHandle, 1356 1353 ASEL_FRAME, (PVOID) & ad.info) || !ad.info) { 1357 break; / * we blew it */1354 break; // we blew it 1358 1355 } 1359 1356 } … … 1369 1366 strcpy(ad.arcname, wk->directory); 1370 1367 AddBackslashToPath(ad.arcname); 1371 //if (ad.arcname[strlen(ad.arcname) - 1] != '\\')1372 // strcat(ad.arcname, "\\");1373 1368 } 1374 1369 if (!WinDlgBox(HWND_DESKTOP, wk->hwndFrame, ArchiveDlgProc, FM3ModHandle, 1375 ARCH_FRAME, (PVOID) & ad) || !*ad.arcname || !*ad.command) / * we blew it */1370 ARCH_FRAME, (PVOID) & ad) || !*ad.arcname || !*ad.command) // we blew it 1376 1371 break; 1377 1372 // Provide extension so containers work … … 1385 1380 strcat(ad.arcname, ad.info->ext); 1386 1381 } 1387 / * build the sucker */1382 // build the sucker 1388 1383 strcpy(szBuffer, ad.command); 1389 1384 strcat(szBuffer, " "); … … 1436 1431 else 1437 1432 wk->li->type = IDM_VIEWBINARY; 1438 / * intentional fallthru */1433 // intentional fallthru 1439 1434 case IDM_VIEWBINARY: 1440 1435 if (*binview) { … … 1445 1440 break; 1446 1441 } 1447 / * else intentional fallthru */1442 // else intentional fallthru 1448 1443 case IDM_VIEWTEXT: 1449 1444 SkipViewing: … … 1482 1477 else 1483 1478 wk->li->type = IDM_EDITBINARY; 1484 / * intentional fallthru */1479 // intentional fallthru 1485 1480 case IDM_EDITBINARY: 1486 1481 if (*bined) { … … 1491 1486 break; 1492 1487 } 1493 / * else intentional fallthru */1488 // else intentional fallthru 1494 1489 case IDM_EDITTEXT: 1495 1490 SkipEditing:
Note:
See TracChangeset
for help on using the changeset viewer.