I think its better to use 0 instead of -1 and various casts. Its clearer and (guint)-1 is potentially a valid timer id.
On 2/2/06, [email protected] <[email protected]> wrote: > linux-ha CVS committal > > Author : alan > Host : > Project : linux-ha > Module : lrm > > Dir : linux-ha/lrm/lrmd > > > Modified Files: > lrmd.c > > > Log Message: > Fixed some cast errors in reference timer tags. > > =================================================================== > RCS file: /home/cvs/linux-ha/linux-ha/lrm/lrmd/lrmd.c,v > retrieving revision 1.202 > retrieving revision 1.203 > diff -u -3 -r1.202 -r1.203 > --- lrmd.c 2 Feb 2006 17:28:38 -0000 1.202 > +++ lrmd.c 2 Feb 2006 17:47:07 -0000 1.203 > @@ -1,4 +1,4 @@ > -/* $Id: lrmd.c,v 1.202 2006/02/02 17:28:38 alan Exp $ */ > +/* $Id: lrmd.c,v 1.203 2006/02/02 17:47:07 alan Exp $ */ > /* > * Local Resource Manager Daemon > * > @@ -420,12 +420,12 @@ > > if ((int)op->repeat_timeout_tag > 0) { > Gmain_timeout_remove(op->repeat_timeout_tag); > - op->repeat_timeout_tag = -1; > + op->repeat_timeout_tag =(guint)-1; > } > > if ((int)op->timeout_tag > 0) { > Gmain_timeout_remove(op->timeout_tag); > - op->timeout_tag = -1; > + op->timeout_tag = (guint)-1; > } > > ha_msg_del(op->msg); > @@ -1644,7 +1644,7 @@ > rsc->repeat_op_list = g_list_remove(rsc->repeat_op_list, op); > if ((int)op->repeat_timeout_tag > 0) { > Gmain_timeout_remove(op->repeat_timeout_tag); > - op->repeat_timeout_tag = -1; > + op->repeat_timeout_tag = (guint)-1; > } > > op->repeat_timeout_tag = -1; > @@ -2598,8 +2598,9 @@ > /* we should check if the resource exists. */ > rsc = lookup_rsc(op->rsc_id); > if (rsc == NULL) { > - if( op->timeout_tag > 0 ) { > + if((int)op->timeout_tag > 0 ) { > Gmain_timeout_remove(op->timeout_tag); > + op->timeout_tag = (guint)-1; > } > lrmd_log(LOG_ERR > , "%s: the resource for the operation %s does not > exist." > @@ -2746,9 +2747,9 @@ > , "on_op_done:%s is removed from op list" > , op_info(op)); > > - if( op->timeout_tag > 0 ) { > + if( (int)op->timeout_tag > 0 ) { > Gmain_timeout_remove(op->timeout_tag); > - op->timeout_tag = -1; > + op->timeout_tag = (guint)-1; > } > > > @@ -3470,6 +3471,9 @@ > } > /* > * $Log: lrmd.c,v $ > + * Revision 1.203 2006/02/02 17:47:07 alan > + * Fixed some cast errors in reference timer tags. > + * > * Revision 1.202 2006/02/02 17:28:38 alan > * Put in a check for a timeout actually being set before removing it... > * > > > _______________________________________________ > Linux-ha-cvs mailing list > [email protected] > http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs > _______________________________________________________ Linux-HA-Dev: [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
