Fixed compilation errors in Linux with GCC 4.2.3.

Fixed fix.sh.
This commit is contained in:
David Capello 2008-10-11 15:52:47 +00:00
parent 07b478907e
commit a1d9d2cada
5 changed files with 28 additions and 26 deletions

24
fix.sh
View File

@ -4,7 +4,7 @@ readln()
{
echo -n "$1 [$2] "
read ans
if [ "$ans" == "" ] ; then ans="$2" ; fi
if [ X"$ans" = X"" ] ; then ans="$2" ; fi
}
######################################################################
@ -34,7 +34,7 @@ memleak=$ans
######################################################################
# prefix
if [ "$platform" == "unix" ] ; then
if [ X"$platform" = X"unix" ] ; then
readln "Where do you want install ASE by default?" "/usr/local"
prefix=$ans
else
@ -56,21 +56,21 @@ echo "ASE configured:"
echo " Platform: $platform_name"
echo -n " Debug suppport: "
if [ "$debug" == "y" ] ; then echo "yes" ; else echo "no" ; fi
if [ X"$debug" = X"y" ] ; then echo "yes" ; else echo "no" ; fi
echo -n " Profile suppport: "
if [ "$profile" == "y" ] ; then echo "yes" ; else echo "no" ; fi
if [ X"$profile" = X"y" ] ; then echo "yes" ; else echo "no" ; fi
echo -n " Check memory leaks: "
if [ "$memleak" == "y" ] ; then echo "yes" ; else echo "no" ; fi
if [ X"$memleak" = X"y" ] ; then echo "yes" ; else echo "no" ; fi
if [ "$prefix" != "" ] ; then
if [ X"$prefix" != X"" ] ; then
echo " Prefix: $prefix"
fi
echo ""
readln "Is it right (y/n)?" "y"
if [ $ans != "y" ] ; then exit ; fi
if [ X"$ans" != X"y" ] ; then exit ; fi
######################################################################
# generate the makefile
@ -97,21 +97,21 @@ gen_makefile()
echo "# Makefile for $platform_name generated with fix.sh" > $makefile
echo "" >> $makefile
if [ "$2" == "conf" ] ; then
if [ X"$2" = X"conf" ] ; then
echo "CONFIGURED = 1" >> $makefile
echo "" >> $makefile
fi
if [ "$debug" != "y" ] ; then echo -n "#" >> $makefile ; fi
if [ X"$debug" != X"y" ] ; then echo -n "#" >> $makefile ; fi
echo "DEBUGMODE = 1" >> $makefile
if [ "profile" != "y" ] ; then echo -n "#" >> $makefile ; fi
if [ X"profile" != X"y" ] ; then echo -n "#" >> $makefile ; fi
echo "PROFILE = 1" >> $makefile
if [ "memleak" != "y" ] ; then echo -n "#" >> $makefile ; fi
if [ X"memleak" != X"y" ] ; then echo -n "#" >> $makefile ; fi
echo "MEMLEAK = 1" >> $makefile
if [ "$prefix" == "" ] ; then echo -n "#" >> $makefile ; fi
if [ X"$prefix" = X"" ] ; then echo -n "#" >> $makefile ; fi
echo "DEFAULT_PREFIX = \"$prefix\"" >> $makefile
echo "" >> $makefile

View File

@ -1000,7 +1000,7 @@ static FileItem *get_fileitem_by_path(const char *path, bool create_if_not)
#endif
key = get_key_for_filename(path);
fileitem = hash_lookup(hash_fileitems, key);
fileitem = reinterpret_cast<FileItem*>(hash_lookup(hash_fileitems, key));
jfree(key);
if (fileitem)

View File

@ -35,6 +35,7 @@
#include <stdio.h>
#include "jinete/jinete.h"
#include "jinete/jintern.h"
/**********************************************************************/
/* Internal messages: to move between menus */

View File

@ -40,27 +40,27 @@
defined ALLEGRO_MACOSX || \
defined ALLEGRO_BEOS || \
defined ALLEGRO_QNX
# define UNIX_LIKE
#define UNIX_LIKE
#endif
#if defined ALLEGRO_WINDOWS
# include <winalleg.h>
# include <process.h>
#include <winalleg.h>
#include <process.h>
#elif defined UNIX_LIKE
# include <pthread.h>
#include <pthread.h>
#endif
#if defined UNIX_LIKE
struct pthread_proxy_data {
void (*proc)(void *data);
void *data;
void (*proc)(void*);
void* data;
};
static void *pthread_proxy(void *arg)
static void* pthread_proxy(void* arg)
{
struct pthread_proxy_data *ptr = arg;
void (*proc)(void *data) = ptr->proc;
void *data = ptr->data;
pthread_proxy_data* ptr = reinterpret_cast<pthread_proxy_data*>(arg);
void (*proc)(void*) = ptr->proc;
void* data = ptr->data;
jfree(ptr);
(*proc)(data);
@ -68,7 +68,7 @@ static void *pthread_proxy(void *arg)
}
#endif
JThread jthread_new(void (*proc)(void *data), void *data)
JThread jthread_new(void (*proc)(void*), void* data)
{
#if defined ALLEGRO_WINDOWS
return (JThread)_beginthread(proc, 0, data);
@ -83,7 +83,7 @@ JThread jthread_new(void (*proc)(void *data), void *data)
else
return (JThread)thread;
#else
#error ASE doesn\'t support threads for your platform
#error ASE does not support threads for your platform
#endif
}
@ -94,6 +94,6 @@ void jthread_join(JThread thread)
#elif defined UNIX_LIKE
pthread_join((pthread_t)thread, NULL);
#else
#error ASE doesn\'t support threads for your platform
#error ASE does not support threads for your platform
#endif
}

View File

@ -20,6 +20,7 @@
#include <allegro.h>
#include "jinete/jinete.h"
#include "jinete/jintern.h"
typedef struct TipData
{