Cleanup some compiler warnings under CentOS 5.5

This patch cleans up a couple of warnings when compiling on CentOS 5.5
using gcc 4.1.2.
This commit is contained in:
Cary R 2010-07-14 17:45:36 -07:00 committed by Stephen Williams
parent a436f7f794
commit 30fa8f64fa
3 changed files with 11 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#ifndef __event_H
#define __event_H
/*
* Copyright (c) 2004-2009 Stephen Williams (steve@icarus.com)
* Copyright (c) 2004-2010 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -122,6 +122,7 @@ struct waitable_hooks_s {
public:
waitable_hooks_s() : event_ctls(0) { last = &event_ctls; }
virtual ~waitable_hooks_s() {}
virtual vthread_t add_waiting_thread(vthread_t thread) = 0;
@ -138,7 +139,7 @@ struct waitable_hooks_s {
* needed is the list of threads waiting on that instance.
*/
struct waitable_state_s {
waitable_state_s() : threads(0) { }
waitable_state_s() : threads(0) {}
vthread_t threads;
};

View File

@ -52,7 +52,10 @@ ufunc_core::ufunc_core(unsigned owid, vvp_net_t*ptr,
functor_ref_lookup(&result_, result_label);
compile_vpi_lookup((vpiHandle*)(&func_scope_), scope_label);
/* A __vpiScope starts with a __vpiHandle structure so this is
a safe cast. We need the (void*) to avoid a dereferenced
type punned pointer warning from some gcc compilers. */
compile_vpi_lookup((vpiHandle*)(void*)(&func_scope_), scope_label);
}
ufunc_core::~ufunc_core()

View File

@ -484,7 +484,10 @@ compile_scope_decl(char*label, char*type, char*name, char*tname,
void compile_scope_recall(char*symbol)
{
compile_vpi_lookup((vpiHandle*)&current_scope, symbol);
/* A __vpiScope starts with a __vpiHandle structure so this is
a safe cast. We need the (void*) to avoid a dereferenced
type punned pointer warning from some gcc compilers. */
compile_vpi_lookup((vpiHandle*)(void*)&current_scope, symbol);
assert(current_scope);
}