summaryrefslogtreecommitdiff
path: root/mysys/ma_dyncol.c
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-05-11 02:28:32 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2011-05-11 02:28:32 +0200
commitc735c1b700ea882115db8b99db04c118ec5b45a1 (patch)
tree7b7a26d3dd1dea3cf1b8cbacafbc01b2c0e1b22e /mysys/ma_dyncol.c
parent052d1bfb1a215d927e31bbe521a7e29d5da8a384 (diff)
downloadmariadb-git-c735c1b700ea882115db8b99db04c118ec5b45a1.tar.gz
Fix compile error by changing #include <mysys_priv.h> to #include "mysys_priv.h"
Fix various warnings about conversion from bigger to smaller integer types in assignments
Diffstat (limited to 'mysys/ma_dyncol.c')
-rw-r--r--mysys/ma_dyncol.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c
index 71eacc6b319..11754d4cec2 100644
--- a/mysys/ma_dyncol.c
+++ b/mysys/ma_dyncol.c
@@ -26,7 +26,7 @@
SUCH DAMAGE.
*/
-#include <mysys_priv.h>
+#include "mysys_priv.h"
#include <m_string.h>
#include <ma_dyncol.h>
@@ -429,7 +429,7 @@ dynamic_column_string_read(DYNAMIC_COLUMN_VALUE *store_it_here,
uchar *data, size_t length)
{
size_t len;
- uint charset_nr= dynamic_column_var_uint_get(data, length, &len);
+ uint charset_nr= (uint)dynamic_column_var_uint_get(data, length, &len);
if (len == 0) /* Wrong packed number */
return ER_DYNCOL_FORMAT;
store_it_here->charset= get_charset(charset_nr, MYF(MY_WME));
@@ -502,12 +502,12 @@ dynamic_column_decimal_read(DYNAMIC_COLUMN_VALUE *store_it_here,
uchar *data, size_t length)
{
size_t intg_len, frac_len;
- uint intg, frac;
+ int intg, frac;
dynamic_column_prepare_decimal(store_it_here);
- intg= dynamic_column_var_uint_get(data, length, &intg_len);
+ intg= (int)dynamic_column_var_uint_get(data, length, &intg_len);
data+= intg_len;
- frac= dynamic_column_var_uint_get(data, length - intg_len, &frac_len);
+ frac= (int)dynamic_column_var_uint_get(data, length - intg_len, &frac_len);
data+= frac_len;
/* Check the size of data is correct */
@@ -602,8 +602,13 @@ dynamic_column_time_store(DYNAMIC_COLUMN *str, MYSQL_TIME *value)
if (value->time_type == MYSQL_TIMESTAMP_NONE ||
value->time_type == MYSQL_TIMESTAMP_ERROR ||
value->time_type == MYSQL_TIMESTAMP_DATE)
- value->neg= value->second_part= value->hour=
- value->minute= value->second= 0;
+ {
+ value->neg= 0;
+ value->second_part= 0;
+ value->hour= 0;
+ value->minute= 0;
+ value->second= 0;
+ }
DBUG_ASSERT(value->hour <= 838);
DBUG_ASSERT(value->minute <= 59);
DBUG_ASSERT(value->second <= 59);
@@ -615,7 +620,7 @@ dynamic_column_time_store(DYNAMIC_COLUMN *str, MYSQL_TIME *value)
*/
buf[0]= (value->second_part & 0xff);
buf[1]= ((value->second_part & 0xff00) >> 8);
- buf[2]= (((value->second & 0xf) << 4) |
+ buf[2]= (uchar)(((value->second & 0xf) << 4) |
((value->second_part & 0xf0000) >> 16));
buf[3]= ((value->minute << 2) | ((value->second & 0x30) >> 4));
buf[4]= (value->hour & 0xff);
@@ -740,9 +745,11 @@ static enum enum_dyncol_func_result
dynamic_column_date_read(DYNAMIC_COLUMN_VALUE *store_it_here,
uchar *data, size_t length)
{
- store_it_here->time_value.neg= store_it_here->time_value.second_part=
- store_it_here->time_value.hour= store_it_here->time_value.minute=
- store_it_here->time_value.second= 0;
+ store_it_here->time_value.neg= 0;
+ store_it_here->time_value.second_part= 0;
+ store_it_here->time_value.hour= 0;
+ store_it_here->time_value.minute= 0;
+ store_it_here->time_value.second= 0;
store_it_here->time_value.time_type= MYSQL_TIMESTAMP_DATE;
return dynamic_column_date_read_internal(store_it_here, data, length);
}