mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
ecffc1b83c
cmd-line-utils/readline/complete.c: Added a cast. dbug/my_main.c: Added an include to avoid implicit declaration of my_thread_global_init() include/my_global.h: undef cannot be used on this predefined name. Since it is a custom fix for gcc 2.8.0, let's make it only effective in that case. include/my_sys.h: Added a new type, TYPE_NOT_SET. myisam/ft_boolean_search.c: Added casts. myisam/mi_key.c: Added cast. myisam/mi_open.c: Added cast. Changed function types. myisam/mi_test1.c: Added cast. myisam/myisamchk.c: Added cast. myisam/myisamdef.h: Changed function type. myisam/myisampack.c: Added casts. myisam/sp_key.c: Added cast. mysys/mf_iocache.c: Fixed invalid use of 0 to info->type. According to comment it should not have been set, but in earlier code by setting it to 0 would have been same as setting it to READ_CACHE. This probably was not desired, potential bug. server-tools/instance-manager/instance_options.cc: Fixed a typo. server-tools/instance-manager/protocol.cc: Changed enum to int. Changed char to uchar. Added casts. sql/mysql_priv.h: Bit overflow. sql/sql_base.cc: Removed unused label. The code below label was unused too, because there is a return just before. sql/sql_parse.cc: Removed unneccessary extra argument.
42 lines
947 B
C
42 lines
947 B
C
/*
|
|
this is modified version of the original example main.c
|
|
fixed so that it could compile and run in MySQL source tree
|
|
*/
|
|
|
|
#ifdef DBUG_OFF /* We are testing dbug */
|
|
#undef DBUG_OFF
|
|
#endif
|
|
|
|
#include <my_global.h> /* This includes dbug.h */
|
|
#include <my_pthread.h>
|
|
|
|
int main (argc, argv)
|
|
int argc;
|
|
char *argv[];
|
|
{
|
|
register int result, ix;
|
|
extern int factorial(int);
|
|
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
|
|
pthread_init(); /* Must be called before DBUG_ENTER */
|
|
#endif
|
|
#ifdef THREAD
|
|
my_thread_global_init();
|
|
#endif
|
|
{
|
|
DBUG_ENTER ("main");
|
|
DBUG_PROCESS (argv[0]);
|
|
for (ix = 1; ix < argc && argv[ix][0] == '-'; ix++) {
|
|
switch (argv[ix][1]) {
|
|
case '#':
|
|
DBUG_PUSH (&(argv[ix][2]));
|
|
break;
|
|
}
|
|
}
|
|
for (; ix < argc; ix++) {
|
|
DBUG_PRINT ("args", ("argv[%d] = %s", ix, argv[ix]));
|
|
result = factorial (atoi(argv[ix]));
|
|
printf ("%d\n", result);
|
|
}
|
|
DBUG_RETURN (0);
|
|
}
|
|
}
|