Weird, eh?

Edward Ballot (eballot@geoworks.com)
Fri, 19 Jul 1996 11:05:43 PDT

Hi Marcus,

> > @message void MSG_BATT_HISTORY_UPDATE_LIFE(word life);
> > @instance word BHI_history[MAX];
> > @instance word BHI_count = 0;
> > @instance optr BHI_genView;
> > @endc
> > @classdecl BattWatchHistoryClass;
> > [...]
> > @object BattWatchHistoryClass BatteryHistory = {
> > BHI_genView = @BatteryView;
> > }
>
> The problem disappears when the line declaring BHI_genView is moved two lines up
> (i.e. before the BHI_history[] line) - needless to say, that this not exactly
> the first thing a programmer tries when messages to the object pointed to by
> BHI_genView show now visible effect... :-)

I would be more inclined to call it a bug in dealing with instance
data that is an array (BHI_history). If you would, please try the two
following tests:
1) In swat, look at BHI_history[1] and BHI_history[2] to see if they
contain the optr data for @BatteryView
2) Try initializing the elements of the array to see if that will fix
the problem.
(I.e., @instance word BHI_history[MAX] = {0,0,0,0,...,0};)

The results of those two tests should give enough information to log a
bug report.

- -Ed-