V0.9: 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:48:19 -07:00 committed by Stephen Williams
parent c09b4035da
commit 39b91f604a
3 changed files with 11 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#ifndef __event_H #ifndef __event_H
#define __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 * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -104,6 +104,7 @@ struct waitable_hooks_s {
public: public:
waitable_hooks_s() : event_ctls(0) { last = &event_ctls; } waitable_hooks_s() : event_ctls(0) { last = &event_ctls; }
virtual ~waitable_hooks_s() {}
virtual vthread_t add_waiting_thread(vthread_t thread) = 0; virtual vthread_t add_waiting_thread(vthread_t thread) = 0;
@ -120,7 +121,7 @@ struct waitable_hooks_s {
* needed is the list of threads waiting on that instance. * needed is the list of threads waiting on that instance.
*/ */
struct waitable_state_s { struct waitable_state_s {
waitable_state_s() : threads(0) { } waitable_state_s() : threads(0) {}
vthread_t threads; vthread_t threads;
}; };

View File

@ -51,7 +51,10 @@ ufunc_core::ufunc_core(unsigned owid, vvp_net_t*ptr,
functor_ref_lookup(&result_, result_label); 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() ufunc_core::~ufunc_core()

View File

@ -479,7 +479,10 @@ compile_scope_decl(char*label, char*type, char*name, char*tname,
void compile_scope_recall(char*symbol) 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); assert(current_scope);
} }