Skip to content

Commit

Permalink
Fix 'signed-to-bigger-unsigned value assignment' warning in GC_setpag…
Browse files Browse the repository at this point in the history
…esize

* include/private/gcconfig.h (GETPAGESIZE): Cast getpagesize() and
sysconf() result to unsigned int.
* tools/setjmp_t.c (main): Change type of "ps" local variable from
long to unsigned int.
  • Loading branch information
ivmai committed Feb 17, 2016
1 parent 3883587 commit 39e2468
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions include/private/gcconfig.h
Expand Up @@ -934,7 +934,7 @@
# define USE_MMAP_ANON
# define MPROTECT_VDB
# include <unistd.h>
# define GETPAGESIZE() getpagesize()
# define GETPAGESIZE() (unsigned)getpagesize()
# if defined(USE_PPC_PREFETCH) && defined(__GNUC__)
/* The performance impact of prefetches is untested */
# define PREFETCH(x) \
Expand Down Expand Up @@ -1133,7 +1133,7 @@
# define HEURISTIC2
# endif
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
# define GETPAGESIZE() (unsigned)sysconf(_SC_PAGESIZE)
/* getpagesize() appeared to be missing from at least one */
/* Solaris 5.4 installation. Weird. */
# define DYNAMIC_LOADING
Expand Down Expand Up @@ -1234,7 +1234,7 @@
# ifdef BEOS
# define OS_TYPE "BEOS"
# include <OS.h>
# define GETPAGESIZE() B_PAGE_SIZE
# define GETPAGESIZE() (unsigned)B_PAGE_SIZE
extern int etext[];
# define DATASTART ((ptr_t)((((word)(etext)) + 0xfff) & ~0xfff))
# endif
Expand Down Expand Up @@ -1299,7 +1299,7 @@
# define STACK_GROWS_DOWN
# define HEURISTIC2
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
# define GETPAGESIZE() (unsigned)sysconf(_SC_PAGESIZE)
# define DYNAMIC_LOADING
# ifndef USE_MMAP
# define USE_MMAP
Expand Down Expand Up @@ -1566,7 +1566,7 @@
# define USE_MMAP_ANON
# define MPROTECT_VDB
# include <unistd.h>
# define GETPAGESIZE() getpagesize()
# define GETPAGESIZE() (unsigned)getpagesize()
/* There seems to be some issues with trylock hanging on darwin. */
/* This should be looked into some more. */
# define NO_PTHREAD_TRYLOCK
Expand Down Expand Up @@ -1783,7 +1783,7 @@
# endif
# define DYNAMIC_LOADING
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
# define GETPAGESIZE() (unsigned)sysconf(_SC_PAGE_SIZE)
# ifndef __GNUC__
# define PREFETCH(x) do { \
register long addr = (long)(x); \
Expand Down Expand Up @@ -1930,7 +1930,7 @@
# define HPUX_STACKBOTTOM
# define DYNAMIC_LOADING
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGE_SIZE)
# define GETPAGESIZE() (unsigned)sysconf(_SC_PAGE_SIZE)
/* The following was empirically determined, and is probably */
/* not very robust. */
/* Note that the backing store base seems to be at a nice */
Expand Down Expand Up @@ -2105,7 +2105,7 @@
# define USE_MMAP_ANON
# define MPROTECT_VDB
# include <unistd.h>
# define GETPAGESIZE() getpagesize()
# define GETPAGESIZE() (unsigned)getpagesize()
/* FIXME: There seems to be some issues with trylock hanging on */
/* darwin. This should be looked into some more. */
# define NO_PTHREAD_TRYLOCK
Expand Down Expand Up @@ -2221,7 +2221,7 @@
# define USE_MMAP_ANON
# define MPROTECT_VDB
# include <unistd.h>
# define GETPAGESIZE() getpagesize()
# define GETPAGESIZE() (unsigned)getpagesize()
/* FIXME: There seems to be some issues with trylock hanging on */
/* darwin. This should be looked into some more. */
# define NO_PTHREAD_TRYLOCK
Expand Down Expand Up @@ -2418,7 +2418,7 @@
# define USE_MMAP_ANON
# define MPROTECT_VDB
# include <unistd.h>
# define GETPAGESIZE() getpagesize()
# define GETPAGESIZE() (unsigned)getpagesize()
/* There seems to be some issues with trylock hanging on darwin. */
/* This should be looked into some more. */
# define NO_PTHREAD_TRYLOCK
Expand Down Expand Up @@ -2631,15 +2631,15 @@

#if (defined(SVR4) || defined(PLATFORM_ANDROID)) && !defined(GETPAGESIZE)
# include <unistd.h>
# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
# define GETPAGESIZE() (unsigned)sysconf(_SC_PAGESIZE)
#endif

#ifndef GETPAGESIZE
# if defined(SOLARIS) || defined(IRIX5) || defined(LINUX) \
|| defined(NETBSD) || defined(FREEBSD) || defined(HPUX)
# include <unistd.h>
# endif
# define GETPAGESIZE() getpagesize()
# define GETPAGESIZE() (unsigned)getpagesize()
#endif

#if defined(PLATFORM_ANDROID) && ((defined(MIPS) && (CPP_WORDSZ == 32)) \
Expand Down
2 changes: 1 addition & 1 deletion tools/setjmp_t.c
Expand Up @@ -70,7 +70,7 @@ int * nested_sp(void)
int main(void)
{
volatile word sp;
long ps = GETPAGESIZE();
unsigned ps = GETPAGESIZE();
jmp_buf b;
register int x = (int)strlen("a"); /* 1, slightly disguised */
static int y = 0;
Expand Down

0 comments on commit 39e2468

Please sign in to comment.