Previous 15994 Revisions Next

r7102 Thursday 21st January, 2010 at 14:34:10 UTC by Miodrag Milanović
More UI fixes
[src/mess]hashfile.c
[src/mess/osd/winui]softwarepicker.c swconfig.c
[src/osd/winui]treeview.c

src/osd/winui/treeview.c
r7101r7102
304304   UINT   i, jj, k;
305305   BOOL b;
306306   int nGames = driver_list_get_count(drivers);
307dprintf("ResetWhichGamesInFolders : %d [%d]\n",nGames,numFolders);
307
308308   for (i = 0; i < numFolders; i++)
309309   {
310310      LPTREEFOLDER lpFolder = treeFolders[i];
r7101r7102
16051605                     fExData->m_nIconId,dwFolderFlags));
16061606   }
16071607
1608   dprintf("CreateAllChildFolders");
16091608   CreateAllChildFolders();
1610dprintf("CreateTreeIcons");
16111609   CreateTreeIcons();
1612dprintf("ResetWhichGamesInFolders");
16131610   ResetWhichGamesInFolders();
1614dprintf("ResetTreeViewFolders");
16151611   ResetTreeViewFolders();
1616dprintf("SelectTreeViewFolder");
16171612   SelectTreeViewFolder(GetSavedFolderID());
1618dprintf("LoadFolderFlags");
16191613   LoadFolderFlags();
1620   dprintf("end of InitFolders");
16211614   return TRUE;
16221615}
16231616
src/mess/osd/winui/swconfig.c
r7101r7102
1717   software_config *config;
1818
1919   // allocate the software_config
20   config = (software_config *)malloc(sizeof(software_config));
20   config = (software_config *)global_alloc_clear(software_config);
2121
2222   // allocate the machine config
2323   config->mconfig = machine_config_alloc(drivers[driver_index]->machine_config);
src/mess/osd/winui/softwarepicker.c
r7101r7102
267267         {
268268            if (!mame_stricmp(zipent->filename, pFileInfo->zip_entry_name))
269269            {
270               pBuffer = (unsigned char *)malloc(zipent->uncompressed_length);
270               pBuffer = (unsigned char *)global_alloc_array_clear(unsigned char,zipent->uncompressed_length);
271271               if (pBuffer)
272272               {
273273                  ziperr = zip_file_decompress(zip, pBuffer, zipent->uncompressed_length);
r7101r7102
397397
398398   // create the FileInfo structure
399399   nSize = sizeof(file_info) + strlen(pszFilename);
400   pInfo = (file_info *) malloc(nSize);
400   pInfo = (file_info *) global_alloc_array(UINT8,nSize);
401401   if (!pInfo)
402402      goto error;
403403   memset(pInfo, 0, nSize);
r7101r7102
423423   else
424424      pInfo->base_name = pInfo->file_name;
425425
426   ppNewIndex = (file_info**)malloc((pPickerInfo->file_index_length + 1) * sizeof(*pPickerInfo->file_index));
426   ppNewIndex = (file_info**)global_alloc_array(UINT8,(pPickerInfo->file_index_length + 1) * sizeof(*pPickerInfo->file_index));
427427   memcpy(ppNewIndex,pPickerInfo->file_index,pPickerInfo->file_index_length * sizeof(*pPickerInfo->file_index));   
428428   if (pPickerInfo->file_index) free(pPickerInfo->file_index);
429429   if (!ppNewIndex)
r7101r7102
534534   pPickerInfo = GetSoftwarePickerInfo(hwndPicker);
535535
536536   nSearchInfoSize = sizeof(directory_search_info) + strlen(pszDirectory);
537   pSearchInfo = (directory_search_info *)malloc(nSearchInfoSize);
537   pSearchInfo = (directory_search_info *)global_alloc_array(UINT8,nSearchInfoSize);
538538   if (!pSearchInfo)
539539      return FALSE;
540540   memset(pSearchInfo, 0, nSearchInfoSize);
r7101r7102
646646   pPickerInfo = GetSoftwarePickerInfo(hwndPicker);
647647
648648   pSearchInfo = pPickerInfo->first_search_info;
649   
649650   if (pSearchInfo)
650651   {
651652      // searching through directories
r7101r7102
674675         SoftwarePicker_FreeSearchInfo(pSearchInfo);
675676      }
676677   }
677/*   else if (pPickerInfo->config->hashfile && (pPickerInfo->hashes_realized
678   else if (pPickerInfo->config!= NULL && pPickerInfo->config->hashfile && (pPickerInfo->hashes_realized
678679      < pPickerInfo->file_index_length))
679680   {
680681      // time to realize some hashes
r7101r7102
708709            pPickerInfo->hashes_realized++;
709710         }
710711      }
711   }*/
712   }
712713   else
713714   {
714715      // we are done!
r7101r7102
834835
835836   if (!SetupPicker(hwndPicker, pOptions))
836837      goto error;
837
838   pPickerInfo = (software_picker_info *)malloc(sizeof(*pPickerInfo));
838   pPickerInfo = (software_picker_info *)global_alloc_clear(software_picker_info);
839839   if (!pPickerInfo)
840840      goto error;
841841   memset(pPickerInfo, 0, sizeof(*pPickerInfo));
842
843842   if (!SetProp(hwndPicker, software_picker_property_name, (HANDLE) pPickerInfo))
844843      goto error;
845844
src/mess/hashfile.c
r7101r7102
577577
578578static void *expat_malloc(size_t size)
579579{
580   return malloc(size);
580   return global_alloc_array_clear(UINT8,size);
581581}
582582
583583static void *expat_realloc(void *ptr, size_t size)
584584{
585   if (ptr) free(ptr);
586   return malloc(size);
585   if (ptr) global_free(ptr);
586   return global_alloc_array_clear(UINT8,size);
587587}
588588
589589static void expat_free(void *ptr)
590590{
591   free(ptr);
591   global_free(ptr);
592592}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team