From 598425e2946ca1796661974e64d48918fd7e0833 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Sun, 7 Jun 2020 08:07:08 -0500 Subject: [PATCH] Start of 64bit clean compile of b2 engine. --- src/engine/debug.cpp | 2 +- src/engine/debug.h | 2 +- src/engine/execcmd.cpp | 2 +- src/engine/execcmd.h | 2 +- src/engine/jam_strings.h | 4 ++-- src/engine/md5.cpp | 10 +++++----- src/engine/md5.h | 2 +- src/engine/object.cpp | 2 +- src/engine/object.h | 2 +- src/engine/pathnt.cpp | 10 +++++----- src/engine/pathsys.h | 2 +- src/engine/w32_getreg.cpp | 4 ++-- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/engine/debug.cpp b/src/engine/debug.cpp index 2a19e072b..8fcf7e362 100644 --- a/src/engine/debug.cpp +++ b/src/engine/debug.cpp @@ -73,7 +73,7 @@ void profile_enter( OBJECT * rulename, profile_frame * frame ) } -void profile_memory( long mem ) +void profile_memory( size_t mem ) { if ( DEBUG_PROFILE ) if ( profile_stack && profile_stack->info ) diff --git a/src/engine/debug.h b/src/engine/debug.h index d61faf450..20824577e 100644 --- a/src/engine/debug.h +++ b/src/engine/debug.h @@ -45,7 +45,7 @@ typedef struct profile_frame profile_frame * profile_init( OBJECT * rulename, profile_frame * ); void profile_enter( OBJECT * rulename, profile_frame * ); -void profile_memory( long mem ); +void profile_memory( size_t mem ); void profile_exit( profile_frame * ); void profile_dump(); double profile_clock(); diff --git a/src/engine/execcmd.cpp b/src/engine/execcmd.cpp index 8e6ec4f50..ecc554664 100644 --- a/src/engine/execcmd.cpp +++ b/src/engine/execcmd.cpp @@ -75,7 +75,7 @@ void argv_from_shell( char const * * argv, LIST * shell, char const * command, * maximum. */ int check_cmd_for_too_long_lines( char const * command, size_t max, - int * const error_length, int * const error_max_length ) + size_t * const error_length, size_t * const error_max_length ) { while ( *command ) { diff --git a/src/engine/execcmd.h b/src/engine/execcmd.h index b39e8ae2d..36f13aecf 100644 --- a/src/engine/execcmd.h +++ b/src/engine/execcmd.h @@ -110,6 +110,6 @@ int is_raw_command_request( LIST * shell ); * are under the specified length limit. */ int check_cmd_for_too_long_lines( char const * command, size_t max, - int * const error_length, int * const error_max_length ); + size_t * const error_length, size_t * const error_max_length ); #endif diff --git a/src/engine/jam_strings.h b/src/engine/jam_strings.h index f47db10af..8cfa119d0 100644 --- a/src/engine/jam_strings.h +++ b/src/engine/jam_strings.h @@ -14,8 +14,8 @@ typedef struct string { char * value; - unsigned long size; - unsigned long capacity; + size_t size; + size_t capacity; char opt[ 32 ]; #ifndef NDEBUG char magic[ 4 ]; diff --git a/src/engine/md5.cpp b/src/engine/md5.cpp index c35d96c5e..2c53be85e 100644 --- a/src/engine/md5.cpp +++ b/src/engine/md5.cpp @@ -320,25 +320,25 @@ md5_init(md5_state_t *pms) } void -md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) +md5_append(md5_state_t *pms, const md5_byte_t *data, size_t nbytes) { const md5_byte_t *p = data; - int left = nbytes; - int offset = (pms->count[0] >> 3) & 63; + size_t left = nbytes; + size_t offset = (pms->count[0] >> 3) & 63; md5_word_t nbits = (md5_word_t)(nbytes << 3); if (nbytes <= 0) return; /* Update the message length. */ - pms->count[1] += nbytes >> 29; + pms->count[1] += md5_word_t(nbytes >> 29); pms->count[0] += nbits; if (pms->count[0] < nbits) pms->count[1]++; /* Process an initial partial block. */ if (offset) { - int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); + size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes); memcpy(pms->buf + offset, p, copy); if (offset + copy < 64) diff --git a/src/engine/md5.h b/src/engine/md5.h index 698c995d8..d76ddcf2c 100644 --- a/src/engine/md5.h +++ b/src/engine/md5.h @@ -79,7 +79,7 @@ extern "C" void md5_init(md5_state_t *pms); /* Append a string to the message. */ -void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); +void md5_append(md5_state_t *pms, const md5_byte_t *data, size_t nbytes); /* Finish the message and return the digest. */ void md5_finish(md5_state_t *pms, md5_byte_t digest[16]); diff --git a/src/engine/object.cpp b/src/engine/object.cpp index 07866baf4..90af92117 100644 --- a/src/engine/object.cpp +++ b/src/engine/object.cpp @@ -248,7 +248,7 @@ static void object_validate( OBJECT * obj ) * object_new_range() - create an object from a string of given length */ -OBJECT * object_new_range( char const * const string, int const size ) +OBJECT * object_new_range( char const * const string, size_t size ) { ++strcount_in; diff --git a/src/engine/object.h b/src/engine/object.h index 03fc0692b..fe59319d2 100644 --- a/src/engine/object.h +++ b/src/engine/object.h @@ -16,7 +16,7 @@ typedef struct _object OBJECT; OBJECT * object_new( char const * const ); -OBJECT * object_new_range( char const * const, int const size ); +OBJECT * object_new_range( char const * const, size_t size ); void object_done( void ); #if defined(NDEBUG) && !defined(BJAM_NO_MEM_CACHE) diff --git a/src/engine/pathnt.cpp b/src/engine/pathnt.cpp index 5b0cc4659..51faf3d3d 100644 --- a/src/engine/pathnt.cpp +++ b/src/engine/pathnt.cpp @@ -94,11 +94,11 @@ void path_get_temp_path_( string * buffer ) * - path_key_cache path/key mapping cache object already initialized */ -static int canonicWindowsPath( char const * const path, int const path_length, +static int canonicWindowsPath( char const * const path, size_t path_length, string * const out ) { char const * last_element; - unsigned long saved_size; + size_t saved_size; char const * p; int missing_parent; @@ -138,7 +138,7 @@ static int canonicWindowsPath( char const * const path, int const path_length, if ( p >= path ) { char const * const dir = path; - int const dir_length = p - path; + const size_t dir_length = p - path; OBJECT * const dir_obj = object_new_range( dir, dir_length ); int found; path_key_entry * const result = (path_key_entry *)hash_insert( @@ -170,7 +170,7 @@ static int canonicWindowsPath( char const * const path, int const path_length, if ( !missing_parent ) { char const * const n = last_element; - int const n_length = path + path_length - n; + size_t n_length = path + path_length - n; if ( !( n_length == 1 && n[ 0 ] == '.' ) && !( n_length == 2 && n[ 0 ] == '.' && n[ 1 ] == '.' ) ) { @@ -239,7 +239,7 @@ static path_key_entry * path_key( OBJECT * const path, if ( !found ) { OBJECT * normalized; - int normalized_size; + size_t normalized_size; path_key_entry * nresult; result->path = path; { diff --git a/src/engine/pathsys.h b/src/engine/pathsys.h index 839476e94..89fac645c 100644 --- a/src/engine/pathsys.h +++ b/src/engine/pathsys.h @@ -29,7 +29,7 @@ typedef struct _pathpart { char const * ptr; - int len; + size_t len; } PATHPART; typedef struct _pathname diff --git a/src/engine/w32_getreg.cpp b/src/engine/w32_getreg.cpp index 1ba06274b..9c83e212a 100644 --- a/src/engine/w32_getreg.cpp +++ b/src/engine/w32_getreg.cpp @@ -43,7 +43,7 @@ static HKEY get_key(char const** path) for (p = dlRootKeys; p->name; ++p) { - int n = strlen(p->name); + size_t n = strlen(p->name); if (!strncmp(*path,p->name,n)) { if ((*path)[n] == '\\' || (*path)[n] == 0) @@ -87,7 +87,7 @@ LIST * builtin_system_registry( FRAME * frame, int flags ) while ( (len = ExpandEnvironmentStringsA( - (LPCSTR)data, expanded->value, expanded->capacity)) + (LPCSTR)data, expanded->value, (DWORD)expanded->capacity)) > expanded->capacity ) string_reserve(expanded, len);