OSDN Git Service

sim: cast away hw/device differences
authorvapier <vapier>
Tue, 23 Nov 2010 11:45:28 +0000 (11:45 +0000)
committervapier <vapier>
Tue, 23 Nov 2010 11:45:28 +0000 (11:45 +0000)
commitd49d50ee43238960bcadfc5dd48d2512b831ca98
tree20327155165b8ab812f60f65b310dd5fd0782276
parent235fbf1fb02f9ed48d29623746f7590cb73a898f
sim: cast away hw/device differences

When building with device and hw support, the sim-core code generates a
lot of build time warnings such as:

./../common/sim-core.c: In function 'sim_core_map_attach':
./../common/sim-core.c:198:7: warning: passing argument 1 of 'device_error' from incompatible pointer type
../common/sim-core.h:347:6: note: expected 'struct device *' but argument is of type 'struct hw *'
./../common/sim-core.c:235:7: warning: passing argument 1 of 'device_error' from incompatible pointer type
../common/sim-core.h:347:6: note: expected 'struct device *' but argument is of type 'struct hw *'

In reality, these two structures get cast back and forth in the core
code already and so are "compatible".  So tweak the three functions
that generate all of these warnings to include the casts automatically.
I know this isn't exactly clean, but the current device/hw ifdef
approach is full of landmines itself and I'm not entirely sure how
to unscrew it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sim/common/ChangeLog
sim/common/sim-core.c