Commit 4b316e6f authored by unknown's avatar unknown
Browse files

unsigned char -> uchar

Added missing copyright
Indentation and prototype fixes
Fixed compiler warning


include/my_sys.h:
  Fix prototype for my_print_open_files.
  Indentation fixes
mysys/mf_keycache.c:
  Fix that key cache can be compiled without #define THREAD
mysys/my_error.c:
  Indentation cleanups
mysys/my_memmem.c:
  Added missing copyright.
  Fix include files
sql/event.cc:
  unsigned char -> uchar
sql/field.cc:
  unsigned char -> uchar
sql/filesort.cc:
  Indentation fix
sql/ha_ndbcluster.cc:
  unsigned char -> uchar
sql/ha_ndbcluster_binlog.cc:
  unsigned char -> uchar
sql/item_strfunc.cc:
  unsigned char -> uchar
sql/log_event.cc:
  unsigned char -> uchar
sql/opt_range.cc:
  Indentation fixes
sql/sql_crypt.cc:
  unsigned char -> uchar
sql/sql_string.cc:
  unsigned char -> uchar
sql/tztime.cc:
  unsigned char -> uchar
storage/heap/hp_extra.c:
  Clear also next_block (See heap_scan_init)
storage/heap/hp_test2.c:
  Set required struct memeber max_table_size
  (Fixes that hp_test2 works again)
storage/myisam/mi_rsamepos.c:
  Fixed bug in mi_rsame_with_pos
strings/decimal.c:
  Fixed compiler warning
parent 7f19b1cc
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -547,7 +547,6 @@ extern File my_open(const char *FileName,int Flags,myf MyFlags);
extern File my_register_filename(File fd, const char *FileName,
				 enum file_type type_of_file,
				 uint error_message_number, myf MyFlags);
extern void my_print_open_files(void);
extern File my_create(const char *FileName,int CreateFlags,
		      int AccessFlags, myf MyFlags);
extern int my_close(File Filedes,myf MyFlags);
@@ -638,7 +637,7 @@ extern void allow_break(void);
#endif

#ifdef EXTRA_DEBUG
void my_print_open_files();
void my_print_open_files(void);
#else
#define my_print_open_files()
#endif
@@ -672,13 +671,15 @@ extern my_string my_path(my_string to,const char *progname,
			 const char *own_pathname_part);
extern my_string my_load_path(my_string to, const char *path,
			      const char *own_path_prefix);
extern int wild_compare(const char *str,const char *wildstr,pbool str_is_pattern);
extern int wild_compare(const char *str,const char *wildstr,
                        pbool str_is_pattern);
extern WF_PACK *wf_comp(my_string str);
extern int wf_test(struct wild_file_pack *wf_pack,const char *name);
extern void wf_end(struct wild_file_pack *buffer);
extern size_s strip_sp(my_string str);
extern void get_date(my_string to,int timeflag,time_t use_time);
extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,pbool remove_garbage);
extern void soundex(CHARSET_INFO *, my_string out_pntr, my_string in_pntr,
                    pbool remove_garbage);
extern int init_record_cache(RECORD_CACHE *info,uint cachesize,File file,
			     uint reclength,enum cache_type type,
			     pbool use_async_io);
+20 −3
Original line number Diff line number Diff line
@@ -470,8 +470,10 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
		     uint age_threshold)
{
  int blocks;
#ifdef THREAD
  struct st_my_thread_var *thread;
  KEYCACHE_WQUEUE *wqueue;
#endif
  DBUG_ENTER("resize_key_cache");

  if (!keycache->key_cache_inited)
@@ -1102,8 +1104,12 @@ static void unreg_request(KEY_CACHE *keycache,

static inline void remove_reader(BLOCK_LINK *block)
{
#ifdef THREAD
  if (! --block->hash_link->requests && block->condvar)
    keycache_pthread_cond_signal(block->condvar);
#else
  --block->hash_link->requests;
#endif
}


@@ -1112,7 +1118,8 @@ static inline void remove_reader(BLOCK_LINK *block)
  signals on its termination
*/

static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block)
static inline void wait_for_readers(KEY_CACHE *keycache __attribute__((unused)),
                                    BLOCK_LINK *block)
{
#ifdef THREAD
  struct st_my_thread_var *thread= my_thread_var;
@@ -1209,7 +1216,6 @@ static HASH_LINK *get_hash_link(KEY_CACHE *keycache,
                                int file, my_off_t filepos)
{
  reg1 HASH_LINK *hash_link, **start;
  KEYCACHE_PAGE page;
#if defined(KEYCACHE_DEBUG)
  int cnt;
#endif
@@ -1264,6 +1270,7 @@ static HASH_LINK *get_hash_link(KEY_CACHE *keycache,
#ifdef THREAD
      /* Wait for a free hash link */
      struct st_my_thread_var *thread= my_thread_var;
      KEYCACHE_PAGE page;
      KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting"));
      page.file= file;
      page.filepos= filepos;
@@ -1588,8 +1595,10 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache,
            /* Remove the hash link for this page from the hash table */
            unlink_hash(keycache, block->hash_link);
            /* All pending requests for this page must be resubmitted */
#ifdef THREAD
            if (block->wqueue[COND_FOR_SAVED].last_thread)
              release_queue(&block->wqueue[COND_FOR_SAVED]);
#endif
          }
          link_to_file_list(keycache, block, file,
                            (my_bool)(block->hash_link ? 1 : 0));
@@ -1669,7 +1678,7 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache,
    portion is less than read_length, but not less than min_length.
*/

static void read_block(KEY_CACHE *keycache,
static void read_block(KEY_CACHE *keycache __attribute__((unused)),
                       BLOCK_LINK *block, uint read_length,
                       uint min_length, my_bool primary)
{
@@ -1707,8 +1716,10 @@ static void read_block(KEY_CACHE *keycache,
    KEYCACHE_DBUG_PRINT("read_block",
                        ("primary request: new page in cache"));
    /* Signal that all pending requests for this page now can be processed */
#ifdef THREAD
    if (block->wqueue[COND_FOR_REQUESTED].last_thread)
      release_queue(&block->wqueue[COND_FOR_REQUESTED]);
#endif
  }
  else
  {
@@ -1973,9 +1984,11 @@ int key_cache_insert(KEY_CACHE *keycache,
        block->length= read_length+offset;
        KEYCACHE_DBUG_PRINT("key_cache_insert",
                            ("primary request: new page in cache"));
#ifdef THREAD
        /* Signal that all pending requests for this now can be processed. */
        if (block->wqueue[COND_FOR_REQUESTED].last_thread)
          release_queue(&block->wqueue[COND_FOR_REQUESTED]);
#endif
      }

      remove_reader(block);
@@ -2219,9 +2232,11 @@ static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block)
  /* Keep track of the number of currently unused blocks. */
  keycache->blocks_unused++;

#ifdef THREAD
  /* All pending requests for this page must be resubmitted. */
  if (block->wqueue[COND_FOR_SAVED].last_thread)
    release_queue(&block->wqueue[COND_FOR_SAVED]);
#endif
}


@@ -2275,12 +2290,14 @@ static int flush_cached_blocks(KEY_CACHE *keycache,
      if (!last_errno)
        last_errno= errno ? errno : -1;
    }
    #ifdef THREAD
    /*
      Let to proceed for possible waiting requests to write to the block page.
      It might happen only during an operation to resize the key cache.
    */
    if (block->wqueue[COND_FOR_SAVED].last_thread)
      release_queue(&block->wqueue[COND_FOR_SAVED]);
#endif
    /* type will never be FLUSH_IGNORE_CHANGED here */
    if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE))
    {
+3 −1
Original line number Diff line number Diff line
@@ -53,8 +53,10 @@ static struct my_err_head
  int                   meh_first;      /* error number matching array slot 0 */
  int                   meh_last;       /* error number matching last slot */
} my_errmsgs_globerrs = {NULL, globerrs, EE_ERROR_FIRST, EE_ERROR_LAST};

static struct my_err_head *my_errmsgs_list= &my_errmsgs_globerrs;


/*
   Error message to user

@@ -76,7 +78,6 @@ int my_error(int nr, myf MyFlags, ...)
  va_list args;
  char ebuff[ERRMSGSIZE + 20];
  DBUG_ENTER("my_error");

  DBUG_PRINT("my", ("nr: %d  MyFlags: %d  errno: %d", nr, MyFlags, errno));

  /* Search for the error messages array, which could contain the message. */
@@ -102,6 +103,7 @@ int my_error(int nr, myf MyFlags, ...)
  DBUG_RETURN((*error_handler_hook)(nr, ebuff, MyFlags));
}


/*
  Error as printf

+18 −1
Original line number Diff line number Diff line
#include "my_base.h"
/* Copyright (C) 2000 MySQL AB

   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
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

#include <my_global.h>
#include <m_string.h>

/*
  my_memmem, port of a GNU extension.
+2 −2
Original line number Diff line number Diff line
@@ -205,8 +205,8 @@ LEX_STRING interval_type_to_name[] = {

int sortcmp_lex_string(LEX_STRING s, LEX_STRING t, CHARSET_INFO *cs)
{
 return cs->coll->strnncollsp(cs, (unsigned char *) s.str,s.length,
                                  (unsigned char *) t.str,t.length, 0);
 return cs->coll->strnncollsp(cs, (uchar *) s.str,s.length,
                                  (uchar *) t.str,t.length, 0);
}


Loading