Skip to content

Commit

Permalink
Fix a bunch of compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nwellnhof committed Dec 30, 2010
1 parent 69c3a2d commit a4061d5
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 20 deletions.
4 changes: 2 additions & 2 deletions compilers/imcc/pbc.c
Expand Up @@ -1621,7 +1621,7 @@ build_key(PARROT_INTERP, ARGIN(SymReg *key_reg))

{
STRING *name = Parrot_key_set_to_string(interp, head);
const char *cname = Parrot_str_to_cstring(interp, name);
char *cname = Parrot_str_to_cstring(interp, name);
SymReg * const r = _get_sym(&IMCC_INFO(interp)->globals->cs->key_consts, cname);

if (r) {
Expand All @@ -1632,7 +1632,7 @@ build_key(PARROT_INTERP, ARGIN(SymReg *key_reg))
store_key_const(interp, cname, k);
}

Parrot_str_free_cstring((char *)cname);
Parrot_str_free_cstring(cname);
}

/* single 'S' keys already have their color assigned */
Expand Down
12 changes: 8 additions & 4 deletions frontend/parrot/main.c
Expand Up @@ -43,7 +43,11 @@ PARROT_PURE_FUNCTION
static int is_all_hex_digits(ARGIN(const char *s))
__attribute__nonnull__(1);

static void Parrot_confess(char * condition, char * file, unsigned int line);
static void Parrot_confess(
const char * condition,
const char * file,
unsigned int line);

static void Parrot_version(void);
PARROT_CAN_RETURN_NULL
static const char * parseflags(
Expand Down Expand Up @@ -274,8 +278,8 @@ is_all_hex_digits(ARGIN(const char *s))

/*
=item C<static void Parrot_confess(char * condition, char * file, unsigned int
line)>
=item C<static void Parrot_confess(const char * condition, const char * file,
unsigned int line)>
Prints an error
Expand All @@ -284,7 +288,7 @@ Prints an error
*/

static void
Parrot_confess(char * condition, char * file, unsigned int line)
Parrot_confess(const char * condition, const char * file, unsigned int line)
{
fprintf(stderr, "Parrot Error: %s (%s:%d)\n", condition, file, line);
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/parrot_debugger/main.c
Expand Up @@ -148,8 +148,8 @@ and C<debug_break> ops in F<ops/debug.ops>.

static void PDB_printwelcome(void);
static void PDB_run_code(PARROT_INTERP, int argc, const char *argv[]);
const unsigned char * Parrot_get_config_hash_bytes();
int Parrot_get_config_hash_length();
const unsigned char * Parrot_get_config_hash_bytes(void);
int Parrot_get_config_hash_length(void);

/*
Expand Down
5 changes: 3 additions & 2 deletions frontend/pbc_merge/main.c
Expand Up @@ -282,7 +282,7 @@ pbc_merge_loadpbc(PARROT_INTERP, ARGIN(const char *fullname))

static void
ensure_libdep(PARROT_INTERP, PackFile_ByteCode *bc, STRING *lib) {
int i;
size_t i;
for (i = 0; i < bc->n_libdeps; i++) {
if (Parrot_str_equal(interp, bc->libdeps[i], lib)) {
return;
Expand Down Expand Up @@ -315,7 +315,8 @@ pbc_merge_bytecode(PARROT_INTERP, ARGMOD(pbc_merge_input **inputs),
int num_inputs, ARGMOD(PackFile *pf))
{
ASSERT_ARGS(pbc_merge_bytecode)
int i, j;
int i;
size_t j;
opcode_t *bc = mem_gc_allocate_typed(interp, opcode_t);
opcode_t cursor = 0;

Expand Down
6 changes: 3 additions & 3 deletions src/library.c
Expand Up @@ -350,11 +350,11 @@ get_search_paths(PARROT_INTERP, enum_lib_paths which)
return VTABLE_get_pmc_keyed_int(interp, lib_paths, which);
}

static const char path_separator = '/';
static const int path_separator = '/';

#ifdef WIN32

static const char win32_path_separator = '\\';
static const int win32_path_separator = '\\';

#endif

Expand Down Expand Up @@ -480,7 +480,7 @@ path_guarantee_trailing_separator(PARROT_INTERP, ARGMOD(STRING *path))
ASSERT_ARGS(path_guarantee_trailing_separator)

/* make sure the path has a trailing slash before appending the file */
if (STRING_ord(interp, path, -1) != path_separator)
if (STRING_ord(interp, path, -1) != (UINTVAL)path_separator)
path = Parrot_str_concat(interp, path,
Parrot_str_chr(interp, path_separator));

Expand Down
2 changes: 2 additions & 0 deletions src/nci/signatures.c
Expand Up @@ -228,6 +228,8 @@ Parrot_nci_sig_to_pcc(PARROT_INTERP, ARGIN(PMC *sig_pmc), ARGOUT(STRING **params
sig_buf[j++] = 'P';
sig_buf[j++] = 's';
break;
default:
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/runcore/profiling.c
Expand Up @@ -629,7 +629,7 @@ store_postop_time(PARROT_INTERP, ARGIN(Parrot_profiling_runcore_t *runcore))

ASSERT_ARGS(store_postop_time)

if (interp->current_runloop_level-1 >= runcore->time_size) {
if (interp->current_runloop_level-1 >= (int)runcore->time_size) {
runcore->time_size *= 2;
runcore->time = mem_gc_realloc_n_typed(interp,
runcore->time, runcore->time_size + 1, UHUGEINTVAL);
Expand Down
12 changes: 6 additions & 6 deletions tools/build/parrot_config_c.pl
Expand Up @@ -45,8 +45,8 @@ =head1 DESCRIPTION
#include "parrot/api.h"
int Parrot_set_config_hash(Parrot_PMC interp_pmc);
unsigned char * Parrot_get_config_hash_bytes();
int Parrot_get_config_hash_length();
const unsigned char * Parrot_get_config_hash_bytes(void);
int Parrot_get_config_hash_length(void);
static const unsigned char parrot_config[] = {
EOF
Expand Down Expand Up @@ -81,14 +81,14 @@ =head1 DESCRIPTION
print << "EOF";
}; /* parrot_config */
unsigned char*
Parrot_get_config_hash_bytes()
const unsigned char *
Parrot_get_config_hash_bytes(void)
{
return (unsigned char*)parrot_config;
return parrot_config;
}
int
Parrot_get_config_hash_length()
Parrot_get_config_hash_length(void)
{
return sizeof(parrot_config);
}
Expand Down

0 comments on commit a4061d5

Please sign in to comment.