diff --git a/builtin.c b/builtin.c index 984b692c3..9858446df 100644 --- a/builtin.c +++ b/builtin.c @@ -3231,7 +3231,7 @@ static int internal_help( wchar_t *cmd ) int builtin_run( wchar_t **argv ) { int (*cmd)(wchar_t **argv)=0; - cmd = hash_get( &builtin, argv[0] ); + cmd = (int (*)(wchar_t **))hash_get( &builtin, argv[0] ); if( argv[1] != 0 && !internal_help(argv[0]) ) { diff --git a/builtin_ulimit.c b/builtin_ulimit.c index 13af9cd5a..16974c555 100644 --- a/builtin_ulimit.c +++ b/builtin_ulimit.c @@ -3,6 +3,8 @@ Functions used for implementing the ulimit builtin. */ +#include "config.h" + #include #include #include @@ -12,8 +14,6 @@ Functions used for implementing the ulimit builtin. #include #include -#include "config.h" - #include "fallback.h" #include "util.h" diff --git a/halloc.c b/halloc.c index dbfbf8ebf..85855daa1 100644 --- a/halloc.c +++ b/halloc.c @@ -41,7 +41,7 @@ typedef struct halloc static halloc_t *halloc_from_data( void *data ) { - return (halloc_t *)(data - sizeof( halloc_t ) ); + return (halloc_t *)(((char *)data) - sizeof( halloc_t ) ); } static void late_free( void *data) @@ -83,7 +83,7 @@ void *halloc( void *context, size_t size ) { res = parent->scratch; parent->scratch_free -= size; - parent->scratch += size; + parent->scratch = ((char *)parent->scratch)+size; } else { @@ -98,7 +98,7 @@ void *halloc( void *context, size_t size ) alloc_spill += parent->scratch_free; #endif res = calloc( 1, size + HALLOC_BLOCK_SIZE ); - parent->scratch = res + size; + parent->scratch = (char *)res + size; parent->scratch_free = HALLOC_BLOCK_SIZE; } else @@ -121,7 +121,7 @@ void *halloc( void *context, size_t size ) #ifdef HALLOC_DEBUG parent_count++; #endif - me->scratch = ((void *)me) + sizeof(halloc_t) + size; + me->scratch = ((char *)me) + sizeof(halloc_t) + size; me->scratch_free = HALLOC_BLOCK_SIZE; al_init( &me->children ); diff --git a/history.c b/history.c index 112e7cfe3..49e51b106 100644 --- a/history.c +++ b/history.c @@ -291,7 +291,7 @@ static void history_save() history_count=0; past_end=1; - history_load( mode_name ); + history_load(); if( real_pos != 0 ) { /* diff --git a/wildcard.c b/wildcard.c index efcec6bbf..ef2748c42 100644 --- a/wildcard.c +++ b/wildcard.c @@ -605,7 +605,7 @@ int wildcard_expand( const wchar_t *wc, /* The maximum length of a file element */ - size_t ln=MAX_FILE_LENGTH; + long ln=MAX_FILE_LENGTH; char * narrow_dir_string = wcs2str( dir_string ); if( narrow_dir_string )