diff options
Diffstat (limited to 'storage/myisam/mi_packrec.c')
-rw-r--r-- | storage/myisam/mi_packrec.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c index 72ce17b6a78..572fe690da8 100644 --- a/storage/myisam/mi_packrec.c +++ b/storage/myisam/mi_packrec.c @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1111,10 +1112,10 @@ static void decode_bytes(MI_COLUMNDEF *rec,MI_BIT_BUFF *bit_buff,uchar *to, bit_buff->error=1; return; /* Can't be right */ } - bit_buff->current_byte= (bit_buff->current_byte << 32) + - ((((uint) bit_buff->pos[3])) + - (((uint) bit_buff->pos[2]) << 8) + - (((uint) bit_buff->pos[1]) << 16) + + bit_buff->current_byte= (bit_buff->current_byte << 32) | + ((((uint) bit_buff->pos[3])) | + (((uint) bit_buff->pos[2]) << 8) | + (((uint) bit_buff->pos[1]) << 16) | (((uint) bit_buff->pos[0]) << 24)); bit_buff->pos+=4; bits+=32; @@ -1205,23 +1206,23 @@ static void decode_bytes(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, return; /* Can't be right */ } #if BITS_SAVED == 32 - bit_buff->current_byte= (bit_buff->current_byte << 24) + - (((uint) ((uchar) bit_buff->pos[2]))) + - (((uint) ((uchar) bit_buff->pos[1])) << 8) + + bit_buff->current_byte= (bit_buff->current_byte << 24) | + (((uint) ((uchar) bit_buff->pos[2]))) | + (((uint) ((uchar) bit_buff->pos[1])) << 8) | (((uint) ((uchar) bit_buff->pos[0])) << 16); bit_buff->pos+=3; bits+=24; #else if (bits) /* We must have at leasts 9 bits */ { - bit_buff->current_byte= (bit_buff->current_byte << 8) + + bit_buff->current_byte= (bit_buff->current_byte << 8) | (uint) ((uchar) bit_buff->pos[0]); bit_buff->pos++; bits+=8; } else { - bit_buff->current_byte= ((uint) ((uchar) bit_buff->pos[0]) << 8) + + bit_buff->current_byte= ((uint) ((uchar) bit_buff->pos[0]) << 8) | ((uint) ((uchar) bit_buff->pos[1])); bit_buff->pos+=2; bits+=16; @@ -1245,14 +1246,14 @@ static void decode_bytes(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff, uchar *to, if (bits < 8) { /* We don't need to check end */ #if BITS_SAVED == 32 - bit_buff->current_byte= (bit_buff->current_byte << 24) + - (((uint) ((uchar) bit_buff->pos[2]))) + - (((uint) ((uchar) bit_buff->pos[1])) << 8) + + bit_buff->current_byte= (bit_buff->current_byte << 24) | + (((uint) ((uchar) bit_buff->pos[2]))) | + (((uint) ((uchar) bit_buff->pos[1])) << 8) | (((uint) ((uchar) bit_buff->pos[0])) << 16); bit_buff->pos+=3; bits+=24; #else - bit_buff->current_byte= (bit_buff->current_byte << 8) + + bit_buff->current_byte= (bit_buff->current_byte << 8) | (uint) ((uchar) bit_buff->pos[0]); bit_buff->pos+=1; bits+=8; @@ -1439,25 +1440,25 @@ static void fill_buffer(MI_BIT_BUFF *bit_buff) } #if BITS_SAVED == 64 - bit_buff->current_byte= ((((uint) ((uchar) bit_buff->pos[7]))) + - (((uint) ((uchar) bit_buff->pos[6])) << 8) + - (((uint) ((uchar) bit_buff->pos[5])) << 16) + - (((uint) ((uchar) bit_buff->pos[4])) << 24) + + bit_buff->current_byte= ((((uint) ((uchar) bit_buff->pos[7]))) | + (((uint) ((uchar) bit_buff->pos[6])) << 8) | + (((uint) ((uchar) bit_buff->pos[5])) << 16) | + (((uint) ((uchar) bit_buff->pos[4])) << 24) | ((ulonglong) - ((((uint) ((uchar) bit_buff->pos[3]))) + - (((uint) ((uchar) bit_buff->pos[2])) << 8) + - (((uint) ((uchar) bit_buff->pos[1])) << 16) + + ((((uint) ((uchar) bit_buff->pos[3]))) | + (((uint) ((uchar) bit_buff->pos[2])) << 8) | + (((uint) ((uchar) bit_buff->pos[1])) << 16) | (((uint) ((uchar) bit_buff->pos[0])) << 24)) << 32)); bit_buff->pos+=8; #else #if BITS_SAVED == 32 - bit_buff->current_byte= (((uint) ((uchar) bit_buff->pos[3])) + - (((uint) ((uchar) bit_buff->pos[2])) << 8) + - (((uint) ((uchar) bit_buff->pos[1])) << 16) + + bit_buff->current_byte= (((uint) ((uchar) bit_buff->pos[3])) | + (((uint) ((uchar) bit_buff->pos[2])) << 8) | + (((uint) ((uchar) bit_buff->pos[1])) << 16) | (((uint) ((uchar) bit_buff->pos[0])) << 24)); bit_buff->pos+=4; #else - bit_buff->current_byte= (uint) (((uint) ((uchar) bit_buff->pos[1]))+ + bit_buff->current_byte= (uint) (((uint) ((uchar) bit_buff->pos[1])) | (((uint) ((uchar) bit_buff->pos[0])) << 8)); bit_buff->pos+=2; #endif |