On 02/21/2011 08:41 AM, Jan Friesse wrote: > Size of unsigned int is not strictly defined to be 4 bytes. > > Signed-off-by: Jan Friesse <[email protected]> > --- > tools/corosync-fplay.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/corosync-fplay.c b/tools/corosync-fplay.c > index f6f3bae..2ecc06a 100644 > --- a/tools/corosync-fplay.c > +++ b/tools/corosync-fplay.c > @@ -358,9 +358,9 @@ static int logsys_rec_get (int rec_idx) { > firstcopy = flt_data_size - rec_idx; > secondcopy -= firstcopy - rec_size; > } > - memcpy (&g_record[0], &flt_data[rec_idx], firstcopy<<2); > + memcpy (&g_record[0], &flt_data[rec_idx], firstcopy * sizeof(unsigned > int)); > if (secondcopy) { > - memcpy (&g_record[firstcopy], &flt_data[0], secondcopy<<2); > + memcpy (&g_record[firstcopy], &flt_data[0], secondcopy * > sizeof(unsigned int)); > } > return ((rec_idx + rec_size) % flt_data_size); > }
This change looks a little fishy. The flight recorder records all data in 32 bit words. I'd prefer uint32_t used in places where you think this interacts. Regards -steve _______________________________________________ Openais mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/openais
