]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_hc.c
reverted compleately because i need to dissscuss this with the other devs of p16
[16.git] / src / lib / 16_hc.c
index 8a75121be64804f6ee84e86072a48e21cc76757d..3c73c6e0cab554ae7a7f78a8234b8278f4ab26ea 100755 (executable)
@@ -52,7 +52,7 @@ long HC_Newfarcoreleft()
 #endif\r
 \r
 //from: https://stackoverflow.com/questions/14386856/c-check-available-ram\r
-void __near* HC_LargestFreeBlock(size_t __far* Size)\r
+void __near* HC_LargestFreeBlock(size_t* Size)\r
 {\r
        size_t s0, s1;\r
        void __near* p;\r
@@ -117,7 +117,7 @@ size_t HC_coreleft(void)
 }\r
 \r
 //far version of above\r
-void __far* HC_LargestFarFreeBlock(dword __far* Size)\r
+void __far* HC_LargestFarFreeBlock(dword* Size)\r
 {\r
        dword s0, s1;\r
        void __far* p;\r
@@ -340,14 +340,14 @@ size_t HC_GetFreeSize(void)
 }\r
 */\r
 \r
-void HCL_HeapWalking (struct _heapinfo __far*h_info, hc_use_t __far*hu, unsigned nearfarswitch)\r
+void HCL_HeapWalking (struct _heapinfo *h_info, hc_use_t *hu, unsigned nearfarswitch)\r
 {\r
        hu->h_free=0; hu->h_total=0; hu->h_used=0;\r
 \r
        h_info->_pentry = NULL;\r
        for(;;) {\r
-               if(nearfarswitch==0) hu->heap_status = _nheapwalk( (struct _heapinfo *)h_info );\r
-               else if(nearfarswitch==1) hu->heap_status = _fheapwalk( (struct _heapinfo *)h_info );\r
+               if(nearfarswitch==0) hu->heap_status = _nheapwalk( h_info );\r
+               else if(nearfarswitch==1) hu->heap_status = _fheapwalk( h_info );\r
                if( hu->heap_status != _HEAPOK ) break;\r
                if((h_info->_useflag == _USEDENTRY ? "USED" : "FREE")=="FREE") hu->h_free += h_info->_size;\r
                if((h_info->_useflag == _USEDENTRY ? "USED" : "FREE")=="USED") hu->h_used += h_info->_size;\r
@@ -438,7 +438,7 @@ void HC_heapdump(global_game_variables_t *gvar)
        nh_info._pentry = NULL;\r
        nh_free=0; nh_total=0; nh_used=0;\r
        for(;;) {\r
-               heap_status = _nheapwalk( (struct _heapinfo *)&nh_info );\r
+               heap_status = _nheapwalk( &nh_info );\r
                if( heap_status != _HEAPOK ) break;\r
                strcpy(scratch,"  "); strcat(scratch,(nh_info._useflag == _USEDENTRY ? "USED" : "FREE")); strcat(scratch," block at ");\r
                sprintf(str, "%Fp", nh_info._pentry); //ultoa((dword)nh_info._pentry,str,16);\r
@@ -459,7 +459,7 @@ nh_info._pentry, nh_info._size );*/
        fh_info._pentry = NULL;\r
        fh_free=0; fh_total=0; fh_used=0;\r
        for(;;) {\r
-               heap_status = _fheapwalk( (struct _heapinfo *)&fh_info );\r
+               heap_status = _fheapwalk( &fh_info );\r
                if( heap_status != _HEAPOK ) break;\r
                strcpy(scratch,"  "); strcat(scratch,(fh_info._useflag == _USEDENTRY ? "USED" : "FREE")); strcat(scratch," block at ");\r
                sprintf(str, "%Fp", fh_info._pentry); //ultoa((dword)fh_info._pentry,str,16);\r
@@ -549,15 +549,11 @@ dword farcoreleft()
 //     return 0x90000UL-16UL;\r
 // #endif\r
 \r
-#if !defined(__LARGE__) && !defined(__COMPACT__) && !defined(__HUGE__)\r
-//----\r
-       return 0x90000UL+16UL;\r
+//---- return 0x90000UL+16UL;\r
 //---- return 589824UL+16UL;\r
-#else\r
 //++++\r
        return HC_farcoreleft();\r
 //stack overflows      return HC_GetFarFreeSize();\r
-#endif\r
 }\r
 \r
 dword coreleft()\r