diff --git a/alliance/src/rds/src/gds_drive.c b/alliance/src/rds/src/gds_drive.c index b7106c1b..833bd8f7 100644 --- a/alliance/src/rds/src/gds_drive.c +++ b/alliance/src/rds/src/gds_drive.c @@ -490,18 +490,22 @@ FILE *fp; } entete(XY, sizeof(coord_t)); - if (islittle()) { - long X = swapl(inst->X); - long Y = swapl(inst->Y); + coord_t xy; + xy.X = inst->X; + xy.Y = inst->Y; - numb = fwrite((char *)&X, sizeof(long), 1, fp); + if (islittle()) { + xy.X = swapi(xy.X); + xy.Y = swapi(xy.Y); + + numb = fwrite((char *)&xy.X, sizeof(int32_t), 1, fp); controle(1); - numb = fwrite((char *)&Y, sizeof(long), 1, fp); + numb = fwrite((char *)&xy.Y, sizeof(int32_t), 1, fp); controle(1); } else { - numb = fwrite((char *)&inst->X, sizeof(long), 1, fp); + numb = fwrite((char *)&xy.X, sizeof(int32_t), 1, fp); controle(1); - numb = fwrite((char *)&inst->Y, sizeof(long), 1, fp); + numb = fwrite((char *)&xy.Y, sizeof(int32_t), 1, fp); controle(1); } diff --git a/alliance/src/rds/src/gds_parse.c b/alliance/src/rds/src/gds_parse.c index dfa2239b..07b0fb33 100644 --- a/alliance/src/rds/src/gds_parse.c +++ b/alliance/src/rds/src/gds_parse.c @@ -832,7 +832,7 @@ char gds_real[sizeof(mag_type)]; short ref_x_axis, abs_mag, abs_ang; ushort strans; double mag, angle; -long x, y; +int32_t x, y; char sym; char poubelle[TRASHSIZE]; int FLAG = 0; @@ -846,14 +846,14 @@ int FLAG = 0; } switch (infobuf.gdscode) { case XY : - lecture1(&x, sizeof(long)); + lecture1(&x, sizeof(int32_t)); if (islittle()) x = swapl(x); - x = (long)(pv_scale * (double)x); - lecture1(&y, sizeof(long)); + x = (int32_t)(pv_scale * (double)x); + lecture1(&y, sizeof(int32_t)); if (islittle()) y = swapl(y); - y = (long)(pv_scale * (double)y); + y = (int32_t)(pv_scale * (double)y); break; case STRANS : lecture1(&strans, sizeof(ushort)); @@ -988,8 +988,8 @@ FILE *fp; coord_tab[0].X = swapl(coord_tab[0].X); coord_tab[0].Y = swapl(coord_tab[0].Y); } - coord_tab[0].X = (long)(pv_scale * (double)coord_tab[0].X); - coord_tab[0].Y = (long)(pv_scale * (double)coord_tab[0].Y); + coord_tab[0].X = (int32_t)(pv_scale * (double)coord_tab[0].X); + coord_tab[0].Y = (int32_t)(pv_scale * (double)coord_tab[0].Y); XYFLAG = 1; break; case TEXTTYPE :