⛏️ index : buildtools.git

author Oliver Tappe <zooey@hirschkaefer.de> 2014-05-12 23:17:14.0 +02:00:00
committer Oliver Tappe <zooey@hirschkaefer.de> 2014-05-12 23:18:24.0 +02:00:00
commit
6c03949644d77f1780689dfa5e79e69bad3f78f1 [patch]
tree
ab929c2abe255e1a9c68ecdda5ca67912cdb09e9
parent
c20a732df8f8b6d0f32c872817f3a0498a5c4761
download
6c03949644d77f1780689dfa5e79e69bad3f78f1.tar.gz

Fix warnings when building jam.

Sorry for the included whitespace cleanup.

Diff

 jam/execunix.c | 26 ++++++++++++++++++--------
 jam/hcache.c   | 54 ++++++++++++++++++++++++++++++++++++++++--------------
 jam/pathunix.c | 20 ++++++++++----------
 3 files changed, 51 insertions(+), 49 deletions(-)

diff --git a/jam/execunix.c b/jam/execunix.c
index 3795c00..62176d3 100644
--- a/jam/execunix.c
+++ b/jam/execunix.c
@@ -15,7 +15,7 @@
 *
 * Each word must be an individual element in a jam variable value.
 *
 * In $(JAMSHELL), % expands to the command string and ! expands to 
 * In $(JAMSHELL), % expands to the command string and ! expands to
 * the slot number (starting at 1) for multiprocess (-j) invocations.
 * If $(JAMSHELL) doesn't include a %, it is tacked on as the last
 * argument.
@@ -50,13 +50,17 @@
# include <process.h>
# endif

# ifdef OS_NT 
# ifdef unix
# include <unistd.h>
# endif

# ifdef OS_NT
# define USE_EXECNT
# include <process.h>
# define WIN32_LEAN_AND_MEAN
# include <windows.h>		/* do the ugly deed */
# define USE_MYWAIT
# if !defined( __BORLANDC__ ) 

# if !defined( __BORLANDC__ )

# define wait my_wait
static int my_wait( int *status );
# endif
@@ -94,7 +98,7 @@
 */

void
execcmd( 
execcmd(
	char *string,
	void (*func)( void *closure, int status ),
	void *closure,
@@ -133,7 +137,7 @@

	    cmdtab[ slot ].tempfile = malloc( strlen( tempdir ) + 32 );

	    sprintf( cmdtab[ slot ].tempfile, "%s\\jam%dt%d.bat", 
	    sprintf( cmdtab[ slot ].tempfile, "%s\\jam%dt%d.bat",
				tempdir, GetCurrentProcessId(), slot );
	}

@@ -223,15 +227,15 @@
	}
# else
# ifdef NO_VFORK
	if ((pid = fork()) == 0) 
	if ((pid = fork()) == 0)
   	{
	    execvp( argv[0], argv );
	    _exit(127);
	}
# else
	if ((pid = vfork()) == 0) 
	if ((pid = vfork()) == 0)
   	{
	    execvp( argv[0], argv );
	    execvp( argv[0], (char* const*)argv );
	    _exit(127);
	}
# endif
@@ -272,10 +276,10 @@
	if( !cmdsrunning )
	    return 0;

	do 
	do
	{
	    /* Pick up process pid and status */
    

	    while( ( w = wait( &status ) ) == -1 && errno == EINTR )
		;

@@ -377,7 +381,7 @@
FAILED:
	errno = GetLastError();
	return -1;
    

}

# endif /* USE_MYWAIT */
diff --git a/jam/hcache.c b/jam/hcache.c
index 9e846a7..fec4f2c 100644
--- a/jam/hcache.c
+++ b/jam/hcache.c
@@ -35,14 +35,14 @@
 *    hcache_init() - read and parse the local .jamdeps file.
 *    hcache_done() - write a new .jamdeps file
 *    hcache() - return list of headers on target.  Use cache or do a scan.
 *    
 *
 * The dependency file format is an ascii file with 1 line per target.
 * Each line has the following fields:
 * @boundname@ timestamp @file@ @file@ @file@ ... \n
 * */

struct hcachedata {
    char		*boundname;
    const char	*boundname;
    time_t		time;
    LIST		*includes;
    LIST		*hdrscan; /* the HDRSCAN value for this target */
@@ -54,7 +54,7 @@


static struct hash *hcachehash = 0;
static HCACHEDATA  *hcachelist = 0; 
static HCACHEDATA  *hcachelist = 0;

static int queries = 0;
static int hits = 0;
@@ -70,10 +70,10 @@
 * We cache the result so the user can't change the cache file during
 * header scanning.
 */
static char*
static const char*
cache_name(void)
{
    static char* name = 0;
    static const char* name = 0;
    if (!name) {
	LIST *hcachevar = var_get("HCACHEFILE");

@@ -116,7 +116,7 @@
 * ASCII 0.  The returned value is as returned by newstr(), so it need
 * not be freed.
 */
char*
const char*
read_netstring(FILE* f)
{
    unsigned long len;
@@ -168,10 +168,10 @@
hcache_init()
{
    HCACHEDATA  cachedata, *c;
    FILE	*f;
    char	*version;
    int		header_count = 0;
    char*	hcachename;
    FILE		*f;
    const char	*version;
    int			header_count = 0;
    const char*	hcachename;

    hcachehash = hashinit (sizeof (HCACHEDATA), "hcache");

@@ -180,7 +180,7 @@

    if (! (f = fopen (hcachename, "rb" )))
	return;
    

    version = read_netstring(f);
    if (!version || strcmp(version, CACHE_FILE_VERSION)) {
	fclose(f);
@@ -189,11 +189,11 @@

    while (1)
    {
	char* record_type;
	char *time_str;
	char *age_str;
	char *includes_count_str;
	char *hdrscan_count_str;
	const char* record_type;
	const char *time_str;
	const char *age_str;
	const char *includes_count_str;
	const char *hdrscan_count_str;
	int i, count;
	LIST *l;

@@ -210,14 +210,14 @@
		    hcachename, record_type ? record_type : "<null>");
	    goto bail;
	}
	

	c = &cachedata;
	    

	c->boundname = read_netstring(f);
	time_str = read_netstring(f);
	age_str = read_netstring(f);
	includes_count_str = read_netstring(f);
	

	if (!c->boundname || !time_str || !age_str
	    || !includes_count_str)
	{
@@ -230,7 +230,7 @@

	count = atoi(includes_count_str);
	for (l = 0, i = 0; i < count; i++) {
	    char* s = read_netstring(f);
	    const char* s = read_netstring(f);
	    if (!s) {
		fprintf(stderr, "invalid %s\n", hcachename);
		goto bail;
@@ -248,7 +248,7 @@

	count = atoi(hdrscan_count_str);
	for (l = 0, i = 0; i < count; i++) {
	    char* s = read_netstring(f);
	    const char* s = read_netstring(f);
	    if (!s) {
		fprintf(stderr, "invalid %s\n", hcachename);
		goto bail;
@@ -272,7 +272,7 @@
    if (DEBUG_HEADER) {
	printf("hcache read from file %s\n", hcachename);
    }
    

 bail:
    fclose(f);
}
@@ -280,12 +280,12 @@
void
hcache_done()
{
    FILE	*f;
    FILE		*f;
    HCACHEDATA  *c;
    int 	header_count = 0;
    char*	hcachename;
    int		maxage;
    
    int 		header_count = 0;
    const char*	hcachename;
    int			maxage;

    if (!hcachehash)
	return;

diff --git a/jam/pathunix.c b/jam/pathunix.c
index 6a3df2b..058b8cc 100644
--- a/jam/pathunix.c
+++ b/jam/pathunix.c
@@ -38,9 +38,7 @@

# ifdef USE_PATHUNIX

# if defined( OS_MACOSX )

/* need unistd for the prototype for getcwd to avoid defaulting return to int on 64bit */
/* XXX: others too ? */
# if defined( unix )

# include <unistd.h>
# endif

@@ -49,13 +47,13 @@
 */

void
path_parse( 
path_parse(
	const char *file,
	PATHNAME *f )
{
	const char *p, *q;
	const char *end;
	

	memset( (char *)f, 0, sizeof( *f ) );

	/* Look for <grist> */
@@ -83,7 +81,7 @@
	{
	    f->f_dir.ptr = file;
	    f->f_dir.len = p - file;
	

	    /* Special case for / - dirname is /, not "" */

	    if( !f->f_dir.len )
@@ -108,7 +106,7 @@
	    f->f_member.ptr = p + 1;
	    f->f_member.len = end - p - 2;
	    end = p;
	} 
	}

	/* Look for .suffix */
	/* This would be memrchr() */
@@ -157,13 +155,13 @@

# if PATH_DELIM == '/'


	if( f->f_root.len 
	if( f->f_root.len
	    && !( f->f_root.len == 1 && f->f_root.ptr[0] == '.' )
	    && !( f->f_dir.len && f->f_dir.ptr[0] == '/' ) )

# else /* unix */

	if( f->f_root.len 
	if( f->f_root.len
	    && !( f->f_root.len == 1 && f->f_root.ptr[0] == '.' )
	    && !( f->f_dir.len && f->f_dir.ptr[0] == '/' )
	    && !( f->f_dir.len && f->f_dir.ptr[0] == '\\' )
@@ -233,8 +231,8 @@
	f->f_suffix.ptr =
	f->f_member.ptr = "";

	f->f_base.len = 
	f->f_suffix.len = 
	f->f_base.len =
	f->f_suffix.len =
	f->f_member.len = 0;
}