From 7184fb857fe284896b0a929e77bd5b9fcd2ef908 Mon Sep 17 00:00:00 2001 From: nokturnal Date: Wed, 15 Jun 2011 19:29:11 +0000 Subject: [PATCH] bugfix in Add_element_to_list(), there were changes in function interface, but they were not applied in function call, so this resulted in program hang when calling fileselector. Bugfix there was no Atari_Memory_free() declaration when __MINT_ define was declared. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1799 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/Makefile | 28 +++++++++++++++++++++++----- src/fileformats.c | 5 +++++ src/filesel.c | 5 +++-- src/misc.c | 3 --- src/misc.h | 5 ++++- 5 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/Makefile b/src/Makefile index a76e2ed1..624d40bf 100644 --- a/src/Makefile +++ b/src/Makefile @@ -209,7 +209,24 @@ else X11LOPT = -lX11 CC = gcc else - + ifeq ($(PLATFORM),FreeMiNT) #10 + #Atari FreeMiNT/TOS specific + DELCOMMAND = rm -rf + MKDIR = mkdir -p + RMDIR = rmdir + CP = cp + ZIP = zip + PLATFORMFILES = gfx2.png + CC = gcc + BIN = ../bin/grafx2.ttp + LUALOPT = -llua + OBJDIR = ../obj/m68k-atari-mint + PLATFORM = m68k-atari-mint + STRIP = strip -s + X11LOPT = + COPT = -W -Wall -m68020-60 -fomit-frame-pointer -pedantic -std=c99 -Wdeclaration-after-statement -D__MINT__ -DNO_INLINE_MATH -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $(JOYCOPT) $(LAYERCOPT) $(LUACOPT) + LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) $(LAYERLOPT) + else # Finally, the default rules that work fine for most unix/gcc systems, linux and freebsd are tested. # Linux and FreeBSD specific (default rules) DELCOMMAND = rm -rf @@ -267,13 +284,13 @@ else #cross compile an exec for atari TOS/MiNT machine CC = m68k-atari-mint-gcc BIN = ../bin/grafx2.ttp - LUALOPT = -llua + LUALOPT = -llua OBJDIR = ../obj/m68k-atari-mint PLATFORM = m68k-atari-mint STRIP = m68k-atari-mint-strip -s - X11LOPT = - COPT = -W -Wall -m68020-60 -fomit-frame-pointer -pedantic -std=c99 -Wdeclaration-after-statement -D__MINT__ -DNO_INLINE_MATH -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $() $(JOYCOPT) $(LAYERCOPT) $(LUACOPT) - LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) $(LAYERLOPT) + X11LOPT = + COPT = -W -Wall -m68020-60 -fomit-frame-pointer -std=c99 -Wdeclaration-after-statement -D__MINT__ -ffast-math -O$(OPTIM) -c -I$(prefix)/include `$(prefix)/bin/libpng12-config --cflags` `$(prefix)/bin/sdl-config --cflags` $(JOYCOPT) $(LAYERCOPT) $(LUACOPT) + LOPT = -static -m68020-60 -lSDL_image `$(prefix)/bin/sdl-config --libs` -L$(prefix)/lib -ltiff -ljpeg `$(prefix)/bin/libpng12-config --libs` -lz -lm $(TTFLOPT) -lfreetype $(LUALOPT) -lm $(LAYERLOPT) -Wl,--stack,32k else # Compiles a regular linux executable for the native platform @@ -298,6 +315,7 @@ else endif endif endif + endif endif ### BUILD SETTINGS are set according to vars set in the platform selection, diff --git a/src/fileformats.c b/src/fileformats.c index 1dc85ded..18baf90c 100644 --- a/src/fileformats.c +++ b/src/fileformats.c @@ -46,6 +46,11 @@ #endif #endif +#ifndef png_jmpbuf +# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) +#endif + + #include #include "errors.h" diff --git a/src/filesel.c b/src/filesel.c index f0eec93c..ce038464 100644 --- a/src/filesel.c +++ b/src/filesel.c @@ -437,7 +437,7 @@ void Read_list_of_files(T_Fileselector *list, byte selected_format) } if(!bFound){ - Add_element_to_list(list, "..",1,Format_filename("/",19,1),ICON_NONE); // add if not present + Add_element_to_list(list, "..",Format_filename("/",19,1),1,ICON_NONE); // add if not present list->Nb_directories ++; } @@ -1401,8 +1401,9 @@ byte Button_Load_or_Save(byte load, T_IO_Context *context) if (load) { #if defined(__MINT__) - chdir(Main_current_directory); static char path[1024]={0}; + + chdir(Main_current_directory); Dgetpath(path,0); strcat(path,PATH_SEPARATOR); strcpy(Main_current_directory,path); diff --git a/src/misc.c b/src/misc.c index d926e305..4c455ee4 100644 --- a/src/misc.c +++ b/src/misc.c @@ -754,11 +754,8 @@ void Zoom_a_line(byte* original_line, byte* zoomed_line, // atari have two kinds of memory // standard and fast ram void Atari_Memory_free(unsigned long *stRam,unsigned long *ttRam){ - //TODO: return STRAM/TT-RAM - unsigned long mem=0; *stRam=Mxalloc(-1L,0); *ttRam = Mxalloc(-1L,1); - } #else // Indique quelle est la mémoire disponible diff --git a/src/misc.h b/src/misc.h index 063125c8..aabeebfe 100644 --- a/src/misc.h +++ b/src/misc.h @@ -146,8 +146,11 @@ dword Timer_start; // Heure de d byte New_preview_is_needed; // Booléen "Il faut relancer le chrono de preview" +#if defined (__MINT__) +void Atari_Memory_free(unsigned long *stRam,unsigned long *ttRam); +#else unsigned long Memory_free(void); - +#endif #define Num2str(a,b,c) sprintf(b,"%*lu",c,(long)(a)) #define Dec2str(a,b,c) sprintf(b,"%.*f",c,(double)(a))