File tree 2 files changed +28
-0
lines changed
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -161,3 +161,26 @@ double wa_fmin(double a, double b) {
161
161
}
162
162
return c;
163
163
}
164
+
165
+
166
+ // WOOD
167
+ uint32_t read_B32 (uint8_t **bytes) {
168
+ uint8_t *b = *bytes;
169
+ uint32_t n = (b[0 ] << 24 ) + (b[1 ] << 16 ) + (b[2 ] << 8 ) + b[3 ];
170
+ *bytes += 4 ;
171
+ return n;
172
+ }
173
+
174
+ uint16_t read_B16 (uint8_t **bytes) {
175
+ uint8_t *b = *bytes;
176
+ uint32_t n = (b[0 ] << 8 ) + b[1 ];
177
+ *bytes += 2 ;
178
+ return n;
179
+ }
180
+
181
+ int read_B32_signed (uint8_t **bytes) {
182
+ uint8_t *b = *bytes;
183
+ int n = (b[0 ] << 24 ) + (b[1 ] << 16 ) + (b[2 ] << 8 ) + b[3 ];
184
+ *bytes += 4 ;
185
+ return n;
186
+ } // TODO replace with read_LEB_32? If keep Big endian use memcpy?
Original file line number Diff line number Diff line change @@ -67,4 +67,9 @@ double wa_fmax(double a, double b);
67
67
68
68
double wa_fmin (double a, double b);
69
69
70
+ // WOOD
71
+ uint32_t read_B32 (uint8_t **bytes);
72
+ uint16_t read_B16 (uint8_t **bytes);
73
+ int read_B32_signed (uint8_t **bytes);
74
+
70
75
#endif
You can’t perform that action at this time.
0 commit comments