Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
966661c8
Commit
966661c8
authored
Sep 11, 2010
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
to simpliy and unify the code
parent
44fec70b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
32 deletions
+17
-32
include/my_global.h
include/my_global.h
+17
-27
sql/item_timefunc.cc
sql/item_timefunc.cc
+0
-5
No files found.
include/my_global.h
View file @
966661c8
...
...
@@ -568,44 +568,34 @@ int __void__;
#endif
/* DONT_DEFINE_VOID */
/*
Try to suppress warning for not initialized variables.
Deprecated workaround for false-positive uninitialized variables
warnings. Those should be silenced using tool-specific heuristics.
With gcc when using C, we suppress the uninitialized variable warning
without generating code. We can't do this with C++
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
Enabled by default for g++ due to the bug referenced below.
*/
#if defined(FORCE_INIT_OF_VARS
)
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
(defined(__GNUC__) && defined(__cplusplus)
)
#define LINT_INIT(var) var= 0
#if defined(__cplusplus) || !defined(__GNUC__)
#define UNINIT_VAR(x) x= 0
#else
/* GCC specific self-initialization which inhibits the warning. */
#define UNINIT_VAR(x) x= x
#endif
#else
/* !FORCE_INIT_OF_VARS */
#define LINT_INIT(var)
#if !defined(__cplusplus) && !defined(__GNUC__)
/* GCC specific self-initialization which inhibits the warning. */
#define UNINIT_VAR(x) x= x
#else
#define UNINIT_VAR(x) x
#endif
#endif
/* FORCE_INIT_OF_VARS */
#include <my_valgrind.h>
/*
The following is to force some unitialized variables to 0 if we are
running valgrind. This is needed when the compiler may access the variable
even if the value of it is never used.
Suppress uninitialized variable warning without generating code.
The _cplusplus is a temporary workaround for C++ code pending a fix
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
*/
#if defined(HAVE_valgrind)
#define VALGRIND_OR_LINT_INIT(var) var=0
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
defined(__cplusplus) || !defined(__GNUC__)
#define UNINIT_VAR(x) x= 0
#else
#define VALGRIND_OR_LINT_INIT(var) LINT_INIT(var)
/* GCC specific self-initialization which inhibits the warning. */
#define UNINIT_VAR(x) x= x
#endif
#include <my_valgrind.h>
/* Define some useful general macros */
#if !defined(max)
#define max(a, b) ((a) > (b) ? (a) : (b))
...
...
@@ -621,7 +611,7 @@ typedef unsigned short ushort;
#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1)
#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
#define swap_variables(t, a, b) { t
swap_dummy; swap_dummy= a; a= b; b= swap_
dummy; }
#define swap_variables(t, a, b) { t
dummy; dummy= a; a= b; b=
dummy; }
#define test(a) ((a) ? 1 : 0)
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
...
...
sql/item_timefunc.cc
View file @
966661c8
...
...
@@ -288,11 +288,6 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
CHARSET_INFO
*
cs
=
&
my_charset_bin
;
DBUG_ENTER
(
"extract_date_time"
);
LINT_INIT
(
strict_week_number
);
/* Remove valgrind varnings when using gcc 3.3 and -O1 */
VALGRIND_OR_LINT_INIT
(
strict_week_number_year_type
);
VALGRIND_OR_LINT_INIT
(
sunday_first_n_first_week_non_iso
);
if
(
!
sub_pattern_end
)
bzero
((
char
*
)
l_time
,
sizeof
(
*
l_time
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment