Closed GoogleCodeExporter closed 9 years ago
Similar patch for decode functions. Also comments can all be removed; I was
just using them to track modifications in my local source tree.
--- pb_decode.c.orig 2012-02-15 07:34:48.000000000 -0800
+++ pb_decode.c 2012-05-22 12:35:43.520295788 -0700
@@ -475,7 +475,14 @@
uint8_t bytes[4] = {0};
bool status = pb_read(stream, bytes, 4);
if (status) {
- uint8_t bebytes[4] = {bytes[3], bytes[2], bytes[1], bytes[0]};
+ // Modifications begin
+ // Description: compiler doesn't like uint8_t bebytes[4] = {bytes[3],
...}
+ uint8_t bebytes[4];
+ bebytes[0] = bytes[3];
+ bebytes[1] = bytes[2];
+ bebytes[2] = bytes[1];
+ bebytes[3] = bytes[0];
+ // Modifications end
memcpy(dest, bebytes, 4);
}
return status;
@@ -490,8 +497,18 @@
uint8_t bytes[8] = {0};
bool status = pb_read(stream, bytes, 8);
if (status) {
- uint8_t bebytes[8] = {bytes[7], bytes[6], bytes[5], bytes[4],
- bytes[3], bytes[2], bytes[1], bytes[0]};
+ // Modifications begin
+ // Description: compiler doesn't like uint8_t bebytes[8] = {bytes[7],
...}
+ uint8_t bebytes[8];
+ bebytes[0] = bytes[7];
+ bebytes[1] = bytes[6];
+ bebytes[2] = bytes[5];
+ bebytes[3] = bytes[4];
+ bebytes[4] = bytes[3];
+ bebytes[5] = bytes[2];
+ bebytes[6] = bytes[1];
+ bebytes[7] = bytes[0];
+ // Modifications end
memcpy(dest, bebytes, 8);
}
return status;
Original comment by kwo...@gmail.com
on 13 Jun 2012 at 6:12
This issue was closed by revision 7e1059628c1d.
Original comment by Petteri.Aimonen
on 13 Jun 2012 at 6:45
Original issue reported on code.google.com by
Petteri.Aimonen
on 13 Jun 2012 at 5:06