Changeset 1877 for trunk/dll/flesh.c


Ignore:
Timestamp:
Oct 11, 2015, 11:43:27 PM (10 years ago)
Author:
Gregg Young
Message:

Remove debug code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/flesh.c

    r1876 r1877  
    9595
    9696static PCSZ pszFleshFocusPath;  // 2015-08-20 SHL
    97 #if 0
    98 BOOL fNoFleshDbgMsg;    // 2015-08-09 SHL FIXME to be gone
    99 #endif
     97
    10098#pragma data_seg(GLOBAL1)
    10199ULONG NoBrokenNotify;
     
    200198                ri.cRecordsInsert = 1;
    201199                ri.fInvalidateRecord = FALSE;
    202 #if 0           // 2015-08-03 SHL FIXME debug
    203                 if (pciL->pszFileName == NullStr)
    204                   DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pciL, pciL->pszFileName); // 2015-08-03 SHL FIXME debug
    205 #endif
    206200                if (!WinSendMsg(hwndCnr,
    207201                                CM_INSERTRECORD, MPFROMP(pciL), MPFROMP(&ri)))
     
    250244    return FALSE;
    251245
    252 #if 0  // 2015-08-03 SHL FIXME debug
    253   if (!fNoFleshDbgMsg) {
    254     DbgMsg(pszSrcFile, __LINE__, "Flesh %s pciParent %p pszFileName %p",
    255            pciParent && (INT)pciParent != -1 && pciParent->pszFileName ?
    256              pciParent->pszFileName : "(null)",
    257            pciParent,
    258            pciParent && (INT)pciParent != -1 ? pciParent->pszFileName : (PVOID)-1); // 2015-08-03 SHL FIXME debug
    259   }
    260 #endif
    261   // 2015-08-06 SHL allow pciL -1
    262   // 2015-08-06 SHL FIXME to not need pszFileName check
    263246  if (!pciParent->fleshed) {
    264247    pciL = (PCNRITEM)WinSendMsg(hwndCnr,
     
    271254      // 2015-08-06 SHL FIXME to ensure this can not happen
    272255      if (!*pciL->pszFileName || !strcmp(pciL->pszFileName, NullStr))
    273         Runtime_Error(pszSrcFile, __LINE__, "Flesh called with pci %p pszFileName (null)", pciL);
    274 #if 0
    275       if (!fNoFleshDbgMsg)
    276         DbgMsg(pszSrcFile, __LINE__, "Flesh RemoveCnrItems() pciL %p \"%s\"",
    277                pciL,
    278                pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-04 SHL FIXME debug
    279       // Assume refernces to pciL already removed from work list
    280 #endif
     256        Runtime_Error(pszSrcFile, __LINE__, "Flesh called with pci %p pszFileName (null)",
     257                      pciL);
    281258    }
    282259    dcd = INSTDATA(hwndCnr);
     
    318295  if (!pciParent || !hwndCnr)
    319296    return;
    320 #if 0
    321   if (!fNoFleshDbgMsg)
    322     DbgMsg(pszSrcFile, __LINE__, "UnFlesh pciParent %p pszFileName \"%s\"", pciParent, pciParent->pszFileName ? pciParent->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug
    323 #endif
    324297  for (;;) {
    325298    pciL = (PCNRITEM)WinSendMsg(hwndCnr,
     
    328301                                MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
    329302    if (!pciL || (INT)pciL == -1)
    330       break;                    // Done
    331 #if 0
    332     if (!fNoFleshDbgMsg)
    333       DbgMsg(pszSrcFile, __LINE__, "UnFlesh RemoveCnrItems() pciL %p \"%s\"", pciL, pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug
    334 #endif
     303      break;   
    335304    RemoveCnrItems(hwndCnr, pciL, 1, CMA_FREE);
    336305    removed = TRUE;
     
    383352  static BOOL brokenlan = FALSE, isbroken = FALSE;
    384353
    385   //DbgMsg(pszSrcFile, __LINE__,"Stubby pciParent %p", pciParent);
    386354  if (!pciParent || (INT)pciParent == -1 || !*pciParent->pszFileName
    387355      || pciParent->pszFileName == NullStr || !hwndCnr)
    388356    return FALSE;
    389 #if 0
    390   if (!fNoFleshDbgMsg)
    391     DbgMsg(pszSrcFile, __LINE__, "Stubby pciParent %p pszFileName %s", pciParent, pciParent->pszFileName); // 2015-08-03 SHL FIXME debug
    392 #endif
    393357  // Build wildcard
    394358  len = strlen(pciParent->pszFileName);
     
    402366  if (!isalpha(*wildcard) || wildcard[1] != ':' || wildcard[2] != '\\') {
    403367    MakeFullName(wildcard);
    404     //DbgMsg(pszSrcFile, __LINE__, "Stubby MakeFullName returned %s", wildcard); // 2015-08-19 SHL FIXME debug
    405368  }
    406369  drvNum = toupper(*pciParent->pszFileName) - 'A';
     
    435398
    436399  fl = includefiles ? FILE_DIRECTORY : MUST_HAVE_DIRECTORY;
    437 
    438   //DbgMsg(pszSrcFile, __LINE__, "Stubby DosFindFirst(%s)", wildcard); // 2015-08-19 SHL FIXME debug
    439 
    440400  rc = DosFindFirst(wildcard,
    441401                    &hDir,
     
    635595            ri.cRecordsInsert = 1;
    636596            ri.fInvalidateRecord = TRUE;
    637 #if 0        // 2015-08-03 SHL FIXME debug
    638             if (pci->pszFileName == NullStr)
    639               DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD %p \"%s\" %.255s", pci, pci->pszFileName, pffb->achName);
    640 #endif
    641597            if (!WinSendMsg(hwndCnr,
    642598                            CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) {
    643599              // Assume busy and try again
    644               DosSleep(50); //05 Aug 07 GKY 100
     600              DosSleep(50);
    645601              WinSetFocus(HWND_DESKTOP, hwndCnr);
    646602              if (WinIsWindow((HAB)0, hwndCnr)) {
    647 #if 0
    648                 if (!fNoFleshDbgMsg) {
    649                   // 2015-08-03 SHL FIXME debug
    650                   //if (pci->pszFileName == NullStr)
    651                   //  DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pci, pci->pszFileName); // 2015-08-03 SHL FIXME debug
    652                 }
    653 #endif
    654603                if (!WinSendMsg(hwndCnr,
    655604                                CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) {
     
    734683    if (!item)
    735684      break;
    736     //DbgMsg(pszSrcFile, __LINE__, "DeleteStaleFleshWorkListItems deleting %p %s", pci, pci->pszFileName ? pci->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug
    737685    List2Delete(&FleshWorkList, item);
    738686    xfree(item, pszSrcFile, __LINE__);
     
    748696 */
    749697
    750 #ifndef AddFleshWorkRequest // 2015-08-03 SHL FIXME debug
     698
    751699BOOL AddFleshWorkRequest(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action)
    752 #else
    753 BOOL AddFleshWorkRequestDbg(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action, PCSZ pszSrcFile_, UINT uSrcLineNo)
    754 #endif
    755700{
    756701  PFLESHWORKITEM item = xmallocz(sizeof(FLESHWORKITEM), pszSrcFile, __LINE__);
     
    762707    return FALSE;
    763708
    764   // 2015-08-03 SHL FIXME debug
    765 #if 0 // 2015-08-13 SHL FIXME to be gone
    766   {
    767     static PSZ itemNames[] = {
    768             "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh"
    769     };
    770 
    771 #   ifdef AddFleshWorkRequest
    772     if (!pci || (INT)pci == -1) {
    773       Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p by %s:%u",
    774              itemNames[item->action],
    775              pci,
    776              pszSrcFile_, uSrcLineNo);
    777     }
    778     else if (!pci->pszFileName) {
    779       Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p pszFileName (null) by %s:%u",
    780              itemNames[item->action],
    781              pci,
    782              pszSrcFile_, uSrcLineNo);
    783     }
    784     else if (!fNoFleshDbgMsg) {
    785       DbgMsg(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName %s by %s:%u",
    786              itemNames[item->action],
    787              pci,
    788              pci->pszFileName,
    789              pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug
    790     }
    791 #else
    792     if (!pci || (INT)pci == -1) {
    793       Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p",
    794              itemNames[item->action],
    795              pci);
    796     }
    797     else if (!pci->pszFileName) {
    798       Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName (null)",
    799              itemNames[item->action],
    800              pci);
    801     }
    802     else if (!fNoFleshDbgMsg) {
    803       DbgMsg(pszSrcFile, __LINE__, "AddFleshWorkRequest action %s pci %p pszFileName %s",
    804              itemNames[item->action],
    805              pci,
    806              pci->pszFileName); // 2015-08-03 SHL FIXME debug
    807     }
    808 #endif
    809   }
    810 #endif
    811709
    812710  xDosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT);
     
    858756 */
    859757
    860 #ifndef WaitFleshWorkListEmpty // 2015-08-03 SHL FIXME debug
     758
    861759VOID WaitFleshWorkListEmpty(PCSZ pszDirName, ULONG ulSleep)
    862 #else
    863 VOID WaitFleshWorkListEmptyDbg(PCSZ pszDirName, ULONG ulSleep, PCSZ pszSrcFile_, UINT uSrcLineNo_)
    864 #endif
    865760{
    866761  APIRET rc;
     
    872767  INT rcCount = 0;
    873768
    874   if (tid == 1 || tid == tidFleshWorkListThread) {
    875 #   ifdef WaitFleshWorkListEmpty
    876     Runtime_Error(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist %sempty by tid %u at %s:%u", IsFleshWorkListEmpty() ? "" : "not ", tid, pszSrcFile_, uSrcLineNo_);
    877 #   else
     769  if (tid == 1 || tid == tidFleshWorkListThread) { // 11 Oct 15 GKY Fixme did we intend to keep this
    878770    Runtime_Error(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called by tid %u", tid);
    879 #   endif
    880771    return;             // Avoid hang
    881772  }
    882 #if 0
    883   else if (IsFleshWorkListEmpty()) {
    884 #   ifdef WaitFleshWorkListEmpty
    885     DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist empty at %s:%u", pszSrcFile_, uSrcLineNo_);
    886 #   else
    887     DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list empty");
    888 #   endif
    889   }
    890 #endif
    891 
    892773  // Can not wait if call from thread 1 or FleshWorkListThread
    893774  for (waited = FALSE; !IsFleshWorkListEmpty(); waited = TRUE) {
    894 
    895 #if 0 // 2015-08-19 SHL FIXME debug
    896 #   ifdef WaitFleshWorkListEmpty
    897     if (!fNoFleshDbgMsg)
    898       DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty by %s:%u", pszSrcFile_, uSrcLineNo_); // 2015-08-07 SHL FIXME debug
    899 #   else
    900     if (!fNoFleshDbgMsg)
    901       DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty"); // 2015-08-07 SHL FIXME debug
    902 #   endif
    903 #endif // 2015-08-19 SHL        FIXME debug
    904 
    905775    // 2015-08-13 SHL
    906776    if (fAmQuitting)
     
    965835  if (pszOld)
    966836    xfree((PVOID)pszOld, pszSrcFile, __LINE__);
    967   //DbgMsg(pszSrcFile, __LINE__, "SetFleshFocusPath focus path set to %s", pszFleshFocusPath); // 2015-08-03 SHL FIXME debug
    968 
    969837}
    970838
     
    1025893        if (!item) {
    1026894          ULONG ul;
    1027 #if 0
    1028           if (!fNoFleshDbgMsg)
    1029             DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread work list empty - waiting"); // 2015-08-03 SHL FIXME debug
    1030 #endif
    1031895          xDosWaitEventSem(hevFleshWorkListChanged, SEM_INDEFINITE_WAIT);
    1032896          xDosResetEventSem(hevFleshWorkListChanged, &ul);
    1033 #if 0
    1034           if (!fNoFleshDbgMsg)
    1035             DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread work hev posted"); // 2015-08-03 SHL FIXME debug
    1036 #endif
    1037897          continue;
    1038898        }
    1039899
    1040         if (WinIsWindow((HAB)0, item->hwndCnr)) {
    1041 #if 0     // 2015-08-07 SHL FIXME debug
    1042           {
    1043             static PSZ itemNames[] = {
    1044                     "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh"
    1045             };
    1046 
    1047             PCNRITEM pci = item->pci;
    1048             if (!fNoFleshDbgMsg) {
    1049               DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread action %s pci %p pszFileName %s",
    1050                      itemNames[item->action],
    1051                      pci,
    1052                      pci && (INT)pci != -1 ?
    1053                        (pci->pszFileName ? pci->pszFileName : "(nullname)") :
    1054                        "(nullpci)"); // 2015-08-03 SHL FIXME debug
    1055             }
    1056           }
    1057 #endif
     900        if (WinIsWindow((HAB)0, item->hwndCnr)) {
    1058901
    1059902          switch (item->action) {
     
    1065908            break;
    1066909          case eStubby:
    1067             // DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread pci %p pszFileName %s", stubbyArgs->pci, stubbyArgs->pci->pszFileName); // 2015-08-03 SHL FIXME debug
    1068910            priority_bumped();
    1069911            Stubby(item->hwndCnr, item->pci);
     
    1093935
    1094936  ProcessDirCount++;
    1095   // DbgMsg(pszSrcFile, __LINE__, "ProcessDirCount %i FixedVolume %i", ProcessDirCount, FixedVolume);
    1096937  if (ProcessDirCount >= FixedVolume) {
    1097938    ProcessDirCount = 0;
     
    1122963  if (rc)
    1123964    return FALSE;                       // Give up
    1124 #if 0
    1125    /*DbgMsg is time consuming
    1126      define FM2_NO_FLESH_DBGMSG to suppress
    1127      2015-08-09 SHL FIXME to be gone
    1128      */
    1129 
    1130   fNoFleshDbgMsg = getenv("FM2_NO_FLESH_DBGMSG") != NULL;
    1131 #endif
    1132965  tidFleshWorkListThread = xbeginthread(FleshWorkThread,
    1133966                           65536,
Note: See TracChangeset for help on using the changeset viewer.