2000-08-10
2000-08-10 17:57:17 by Henrik Grubbström (Grubba) <grubba@grubba.org>
-
d3b06ff2f69cacc84d3796aefbbb9460ecfd56fe
(35 lines)
(+18/-17)
[
Show
| Annotate
]
Branch: 7.9
Fixed a few warnings.
Rev: src/program.c:1.258
Rev: src/stralloc.c:1.93
Rev: src/stralloc.h:1.52
5:
\*/
/**/
#include "global.h"
- RCSID("$Id: program.c,v 1.257 2000/08/10 17:46:34 grubba Exp $");
+ RCSID("$Id: program.c,v 1.258 2000/08/10 17:51:34 grubba Exp $");
#include "program.h"
#include "object.h"
#include "dynamic_buffer.h"
1087:
}
}
- static int alignof_variable(int run_time_type)
+ static ptrdiff_t alignof_variable(int run_time_type)
{
switch(run_time_type)
{
1384:
*/
PMOD_EXPORT size_t low_add_storage(size_t size, size_t alignment, int modulo_orig)
{
- long offset;
- int modulo;
+ ptrdiff_t offset;
+ ptrdiff_t modulo;
if(!size) return Pike_compiler->new_program->storage_needed;
1428: Inside #if defined(PIKE_DEBUG)
if( (offset /* + OFFSETOF(object,storage) */ - modulo_orig ) % alignment )
fatal("add_storage failed horribly(2) %ld %ld %ld %ld!\n",
- (long)offset,
+ DO_NOT_WARN((long)offset),
(long)0 /* + OFFSETOF(object,storage) */,
(long)modulo_orig,
- (long)alignment
- );
+ DO_NOT_WARN((long)alignment));
#endif
1659:
INT32 flags,
struct pike_string *name)
{
- int e, inherit_offset, storage_offset;
+ int e;
+ ptrdiff_t inherit_offset, storage_offset;
struct inherit inherit;
struct pike_string *s;
2782: Inside #if defined(FIND_FUNCTION_HASHSIZE)
#ifdef FIND_FUNCTION_HASHSIZE
if(prog -> flags & PROGRAM_FIXED)
{
- unsigned int hashval;
- hashval=my_hash_string(name);
- hashval+=prog->id;
- hashval^=(unsigned long)prog;
- hashval-=name->str[0];
- hashval%=FIND_FUNCTION_HASHSIZE;
+ size_t hashval;
+ hashval = my_hash_string(name);
+ hashval += prog->id;
+ hashval ^= (size_t)prog;
+ hashval -= name->str[0];
+ hashval %= FIND_FUNCTION_HASHSIZE;
if(is_same_string(cache[hashval].name,name) &&
cache[hashval].id==prog->id)
return cache[hashval].fun;
3087:
{
static char *file, *cnt;
static INT32 off,line,pid;
- INT32 offset;
+ ptrdiff_t offset;
if (prog == 0) return "Unkown program";
offset = pc - prog->program;
3145:
VSPRINTF(buf, fmt, args);
#endif /* HAVE_VSNPRINTF */
- if((long)strlen(buf) >= (long)sizeof(buf))
+ if((size_t)strlen(buf) >= (size_t)sizeof(buf))
fatal("Buffer overflow in my_yyerror.\n");
yyerror(buf);
3643: Inside #if defined(GC2) and #if defined(PIKE_DEBUG)
#ifdef PIKE_DEBUG
if(debug_gc_check(p->inherits[e].parent,T_PROGRAM,p)==-2)
fprintf(stderr,"(program at 0x%lx -> inherit[%d].parent)\n",
- (long)p,
+ DO_NOT_WARN((long)p),
e);
#else
debug_gc_check(p->inherits[e].parent, T_PROGRAM, p);