Commit 7191e775 authored by unknown's avatar unknown
Browse files

Fixed portability issue in my_thr_init.c (was added in my last push)

Fixed compiler warnings (detected by VC++):
- Removed not used variables
- Added casts
- Fixed wrong assignments to bool
- Fixed wrong calls with bool arguments
- Added missing argument to store(longlong), which caused wrong store method to be called.



client/mysqldump.c:
  Removed compiler warning
heap/hp_clear.c:
  Removed compiler warning
include/my_global.h:
  Removed compiler warning
include/my_tree.h:
  Changed memory limits from int to ulong
  (Allowed me to get rid of some compiler warnings)
myisam/mi_create.c:
  Removed compiler warning
myisam/myisampack.c:
  Removed compiler warning
mysys/base64.c:
  Removed compiler warning
mysys/my_thr_init.c:
  Fixed portability issue (detected on windows)
  Added DBUG_ASSERT to detect if we call my_thread_end() too many times
  Don't wait if THR_thread_count == -1 (error condition)
mysys/tree.c:
  Removed compiler warning
sql/field.cc:
  Removed compiler warning
  Fixed wrong parameter to check_date()
  Added missing argument to store(longlong)
sql/ha_archive.cc:
  Removed compiler warning
sql/ha_federated.cc:
  Removed compiler warning
sql/ha_innodb.cc:
  Removed not used variable
sql/handler.cc:
  Removed not used variable
  Fixed wrong if (we didn't detect if rollback or commit failed). Not critical as value is not yet used
sql/item.cc:
  Removed compiler warning
sql/item_func.cc:
  Removed compiler warning
sql/item_strfunc.cc:
  Removed compiler warning
sql/item_timefunc.cc:
  Removed compiler warning
sql/log.cc:
  Removed compiler warning
sql/mysql_priv.h:
  Removed compiler warning
sql/opt_range.cc:
  Removed compiler warning
sql/password.c:
  Removed compiler warning
sql/set_var.cc:
  Removed compiler warning
sql/slave.cc:
  Removed compiler warning
sql/sp.cc:
  Removed compiler warning
sql/sp_cache.cc:
  Removed compiler warning
sql/sp_head.cc:
  Removed compiler warning
  Adjusted argument to reserve() to not use up too much memory that we are probably not going to need
sql/sql_acl.cc:
  Added missing argument to store(longlong)
sql/sql_base.cc:
  Removed compiler warning
sql/sql_db.cc:
  Removed compiler warning
sql/sql_delete.cc:
  Removed compiler warning
sql/sql_handler.cc:
  Removed not used variable
sql/sql_lex.h:
  Removed not used variable
sql/sql_prepare.cc:
  Removed not used variable
sql/sql_rename.cc:
  Removed not used variable
sql/sql_select.cc:
  Fixed that select_options are not 'cut'
  Removed some not used variables
  Removed compiler warnings by adding cast
sql/sql_show.cc:
  Removed not used variables
  Added missing argument to store(longlong)
  Removed compiler warnings
sql/sql_trigger.cc:
  Removed not used variables
  Added cast to remove compiler warnings
sql/sql_update.cc:
  Fixed wrong set of bool variable
sql/sql_view.cc:
  Removed not used variables
  Added cast to get rid of compiler warnings
sql-common/client.c:
  Fixed compiler warning
sql-common/my_time.c:
  Fixed wrong argument to check_date()
  Added casts to get rid of compiler warnings
sql/sql_yacc.yy:
  Removed not used variable
sql/uniques.cc:
  Changes memory size from uint to ulong
  Added casts to get rid of compiler warnings
strings/ctype-simple.c:
  Fixed cast to get rid of compiler warnings
parent 42fd48da
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2001,7 +2001,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
    write_footer(sql_file);
    my_fclose(sql_file, MYF(MY_WME));
  }
  DBUG_RETURN(num_fields);
  DBUG_RETURN((uint) num_fields);
} /* get_table_structure */


+2 −1
Original line number Diff line number Diff line
@@ -36,7 +36,8 @@ void hp_clear(HP_SHARE *info)
			(byte*) 0));
  info->block.levels=0;
  hp_clear_keys(info);
  info->records=info->deleted=info->data_length=0;
  info->records= info->deleted= 0;
  info->data_length= 0;
  info->blength=1;
  info->changed=0;
  info->del_link=0;
+2 −2
Original line number Diff line number Diff line
@@ -1040,8 +1040,8 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
  ulonglong now= my_getsystime() + (NSEC/100); \
  (ABSTIME).tv_sec=  (now / ULL(10000000)); \
  (ABSTIME).tv_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100));    \
  (ABSTIME).tv_sec=  (time_t) (now / ULL(10000000));                  \
  (ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif /* !set_timespec_nsec */
#endif /* HAVE_TIMESPEC_TS_SEC */
+3 −2
Original line number Diff line number Diff line
@@ -59,7 +59,8 @@ typedef struct st_tree_element {
typedef struct st_tree {
  TREE_ELEMENT *root,null_element;
  TREE_ELEMENT **parents[MAX_TREE_HEIGHT];
  uint offset_to_key,elements_in_tree,size_of_element,memory_limit,allocated;
  uint offset_to_key,elements_in_tree,size_of_element;
  ulong memory_limit, allocated;
  qsort_cmp2 compare;
  void *custom_arg;
  MEM_ROOT mem_root;
@@ -69,7 +70,7 @@ typedef struct st_tree {
} TREE;

	/* Functions on whole tree */
void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
               int size, qsort_cmp2 compare, my_bool with_delete,
	       tree_element_free free_element, void *custom_arg);
void delete_tree(TREE*);
+2 −2
Original line number Diff line number Diff line
@@ -428,7 +428,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
	key_segs)
      share.state.rec_per_key_part[key_segs-1]=1L;
    length+=key_length;
    keydef->block_length= MI_BLOCK_SIZE(length-real_length_diff,
    keydef->block_length= (uint16) MI_BLOCK_SIZE(length-real_length_diff,
                                                 pointer,MI_MAX_KEYPTR_SIZE);
    if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH ||
        length >= MI_MAX_KEY_BUFF)
Loading