diff --git a/src/filesel.c b/src/filesel.c index 9bfa242f..96c6ccb0 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -360,7 +360,16 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format) char * filter = "*"; // Extension demandée struct stat Infos_enreg; char * current_path; - +#if defined (__MINT__) + char path[1024]={0}; + char path2[1024]={0}; + char currentDrive=0; + T_Fileselector_item *item=0; + bool bFound=false; + path[0]='\0'; + path2[0]='\0'; +#endif + // Tout d'abord, on déduit du format demandé un filtre à utiliser: filter = Get_fileformat(selected_format)->Extensions; @@ -371,12 +380,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format) // On lit tous les répertoires: #if defined (__MINT__) - static char path[1024]; - static char path2[1024]; - path[0]='\0'; - path2[0]='\0'; - - char currentDrive='A'; + currentDrive='A'; currentDrive=currentDrive+Dgetdrv(); Dgetpath(path,0); @@ -472,12 +476,11 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format) } #elif defined (__MINT__) - T_Fileselector_item *item=NULL; // check if ".." exists if not add it // FreeMinT lists ".." already, but this is not so for TOS // simply adding it will cause double PARENT_DIR under FreeMiNT - bool bFound= false; + bFound= false; for (item = list->First; (((item != NULL) && (bFound==false))); item = item->Next){ if (item->Type == 1){ @@ -538,7 +541,13 @@ void bstrtostr( BSTR in, STRPTR out, TEXT max ) // -- Lecture d'une liste de lecteurs / volumes ----------------------------- void Read_list_of_drives(T_Fileselector *list, byte name_length) { - +#if defined(__MINT__) + char drive_name[]="A:\\"; + unsigned long drive_bits=0; + int drive_index=0; + int bit_index=0; +#endif + // Empty the current content of fileselector: Free_fileselector_list(list); // Reset number of items @@ -608,11 +617,8 @@ void Read_list_of_drives(T_Fileselector *list, byte name_length) } } #elif defined(__MINT__) - char drive_name[]="A:\\"; - unsigned long drive_bits = Drvmap(); //get drive map bitfield - int drive_index; - int bit_index; - drive_index = 0; + drive_bits = Drvmap(); //get drive map bitfield + for (bit_index=0; bit_index<32; bit_index++) { if ( (1 << bit_index) & drive_bits ) diff --git a/src/help.c b/src/help.c index ee8ae7ee..cd868e81 100644 --- a/src/help.c +++ b/src/help.c @@ -692,7 +692,12 @@ void Button_Stats(void) unsigned long long freeRam; qword mem_size = 0; int y; - +#if defined (__MINT__) + _DISKINFO drvInfo; + unsigned long STRAM=0,TTRAM=0; + char helpBuf[64]={0}; +#endif + Open_window(310,174,"Statistics"); // Dessin de la fenetre ou va s'afficher le texte @@ -718,9 +723,8 @@ void Button_Stats(void) #if defined (__MINT__) // Display free TT/ST RAM freeRam=0; - char helpBuf[64]; - unsigned long STRAM,TTRAM; + Atari_Memory_free(&STRAM,&TTRAM); freeRam=STRAM+TTRAM; buffer[0]='\0'; @@ -734,7 +738,7 @@ void Button_Stats(void) strncat(buffer,helpBuf,sizeof(char)*37); - if(TTRAM > (100ULL*1024*1024*1024)) + if(TTRAM > (100UL*1024UL*1024UL*1024UL)) sprintf(helpBuf,"TT:%u Gb",(unsigned int)(TTRAM/(1024*1024*1024))); else if(TTRAM > (100*1024*1024)) sprintf(helpBuf,"TT:%u Mb",(unsigned int)(TTRAM/(1024*1024))); @@ -799,17 +803,15 @@ void Button_Stats(void) mem_size=(qword) disk_info.f_bfree * (qword) disk_info.f_bsize; } #elif defined(__HAIKU__) - mem_size = haiku_get_free_space(Main_selector.Directory); + mem_size = haiku_get_free_space(Main_selector.Directory); #elif defined (__MINT__) - _DISKINFO drvInfo; mem_size=0; Dfree(&drvInfo,0); //number of free clusters*sectors per cluster*bytes per sector; // reports current drive mem_size=drvInfo.b_free*drvInfo.b_clsiz*drvInfo.b_secsiz; - #else - #define NODISKSPACESUPPORT + #define NODISKSPACESUPPORT // Free disk space is only for shows. Other platforms can display 0. #warning "Missing code for your platform !!! Check and correct please :)" mem_size=0; diff --git a/src/realpath.c b/src/realpath.c index 16b3a829..f1da9b25 100644 --- a/src/realpath.c +++ b/src/realpath.c @@ -6,7 +6,7 @@ #include #include #include -#if defined(__AROS__) || defined(__linux__) || defined(__GLIBC__) +#if defined(__AROS__) || defined(__linux__) || defined(__GLIBC__)|| defined(__MINT__) #include #endif