@@ -284,13 +284,13 @@ long oggpack_look(oggpack_buffer *b,int bits){
284284
285285 ret = b -> ptr [0 ]>>b -> endbit ;
286286 if (bits > 8 ){
287- ret |=b -> ptr [1 ]<<(8 - b -> endbit );
287+ ret |=( unsigned long ) b -> ptr [1 ]<<(8 - b -> endbit );
288288 if (bits > 16 ){
289- ret |=b -> ptr [2 ]<<(16 - b -> endbit );
289+ ret |=( unsigned long ) b -> ptr [2 ]<<(16 - b -> endbit );
290290 if (bits > 24 ){
291- ret |=b -> ptr [3 ]<<(24 - b -> endbit );
291+ ret |=( unsigned long ) b -> ptr [3 ]<<(24 - b -> endbit );
292292 if (bits > 32 && b -> endbit )
293- ret |=b -> ptr [4 ]<<(32 - b -> endbit );
293+ ret |=( unsigned long ) b -> ptr [4 ]<<(32 - b -> endbit );
294294 }
295295 }
296296 }
@@ -313,13 +313,13 @@ long oggpackB_look(oggpack_buffer *b,int bits){
313313 else if (!bits )return (0L );
314314 }
315315
316- ret = b -> ptr [0 ]<<(24 + b -> endbit );
316+ ret = ( unsigned long ) b -> ptr [0 ]<<(24 + b -> endbit );
317317 if (bits > 8 ){
318- ret |=b -> ptr [1 ]<<(16 + b -> endbit );
318+ ret |=( unsigned long ) b -> ptr [1 ]<<(16 + b -> endbit );
319319 if (bits > 16 ){
320- ret |=b -> ptr [2 ]<<(8 + b -> endbit );
320+ ret |=( unsigned long ) b -> ptr [2 ]<<(8 + b -> endbit );
321321 if (bits > 24 ){
322- ret |=b -> ptr [3 ]<<(b -> endbit );
322+ ret |=( unsigned long ) b -> ptr [3 ]<<(b -> endbit );
323323 if (bits > 32 && b -> endbit )
324324 ret |=b -> ptr [4 ]>>(8 - b -> endbit );
325325 }
@@ -389,13 +389,13 @@ long oggpack_read(oggpack_buffer *b,int bits){
389389
390390 ret = b -> ptr [0 ]>>b -> endbit ;
391391 if (bits > 8 ){
392- ret |=b -> ptr [1 ]<<(8 - b -> endbit );
392+ ret |=( unsigned long ) b -> ptr [1 ]<<(8 - b -> endbit );
393393 if (bits > 16 ){
394- ret |=b -> ptr [2 ]<<(16 - b -> endbit );
394+ ret |=( unsigned long ) b -> ptr [2 ]<<(16 - b -> endbit );
395395 if (bits > 24 ){
396- ret |=b -> ptr [3 ]<<(24 - b -> endbit );
396+ ret |=( unsigned long ) b -> ptr [3 ]<<(24 - b -> endbit );
397397 if (bits > 32 && b -> endbit ){
398- ret |=b -> ptr [4 ]<<(32 - b -> endbit );
398+ ret |=( unsigned long ) b -> ptr [4 ]<<(32 - b -> endbit );
399399 }
400400 }
401401 }
@@ -430,13 +430,13 @@ long oggpackB_read(oggpack_buffer *b,int bits){
430430 else if (!bits )return (0L );
431431 }
432432
433- ret = b -> ptr [0 ]<<(24 + b -> endbit );
433+ ret = ( unsigned long ) b -> ptr [0 ]<<(24 + b -> endbit );
434434 if (bits > 8 ){
435- ret |=b -> ptr [1 ]<<(16 + b -> endbit );
435+ ret |=( unsigned long ) b -> ptr [1 ]<<(16 + b -> endbit );
436436 if (bits > 16 ){
437- ret |=b -> ptr [2 ]<<(8 + b -> endbit );
437+ ret |=( unsigned long ) b -> ptr [2 ]<<(8 + b -> endbit );
438438 if (bits > 24 ){
439- ret |=b -> ptr [3 ]<<(b -> endbit );
439+ ret |=( unsigned long ) b -> ptr [3 ]<<(b -> endbit );
440440 if (bits > 32 && b -> endbit )
441441 ret |=b -> ptr [4 ]>>(8 - b -> endbit );
442442 }
0 commit comments