Merge lp:~jobinau/drizzle/reviews into lp:~drizzle-trunk/drizzle/development

Proposed by Jobin Augustine
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jobinau/drizzle/reviews
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 20 lines (+2/-2)
1 file modified
plugin/myisam/mi_search.cc (+2/-2)
To merge this branch: bzr merge lp:~jobinau/drizzle/reviews
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Monty Taylor Approve
Review via email: mp+22254@code.launchpad.net

Description of the change

This is a fix for Warning as Error bug 537880.
GCC optimization -Os gives a strong warning (Error) that _mi_seq_search is retuning flag which is not initialized.
other replacement search functions _mi_prefix_search,_mi_seq_search are initializing their return flag as "0".
so this patch initializes flag in _mi_seq_search to "0".

This was the only obstacle to achive -Os optimization in GCC.

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

Hi Jobin!

Good for you getting your feet wet with the code base! :)

One tiny thing, though...we use no space before and one space after the assignment operator, so you should change:

int flag=0;

to int flag= 0;

I know, I know, I'm being strict on code style! Here is the coding guidelines:

http://drizzle.org/wiki/Coding_Standards

Cheers and welcome to the contributor community!

Jay

review: Needs Fixing
Revision history for this message
Monty Taylor (mordred) wrote :

Fantastic.

I'm going to be mean and say that this needs fixing. Drizzle Style Guidelines say that there should be a space after the = but not before.

HOWEVER - this is great. Thanks!

review: Needs Fixing
Revision history for this message
Jobin Augustine (jobinau) wrote :

Thank you Jay and Monty for your kind review comments.
Yes Jay, my first patch request. :)
I will fix that and submit again.
Since i am using bzr to this extend first time, I am bit slow. please bear
with me.

lp:~jobinau/drizzle/reviews updated
1407. By jobin <jobin@jobin-laptop>

correcting for the coding standard for the ealier fix

1408. By jobin <jobin@jobin-laptop>

modified for the coding standard

Revision history for this message
Monty Taylor (mordred) wrote :

Wonderful! Looks great. Thanks!

review: Approve
Revision history for this message
Jay Pipes (jaypipes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugin/myisam/mi_search.cc'
2--- plugin/myisam/mi_search.cc 2010-02-04 08:14:46 +0000
3+++ plugin/myisam/mi_search.cc 2010-03-26 19:41:36 +0000
4@@ -175,7 +175,7 @@
5 {
6 (void)buff;
7 register int start,mid,end,save_end;
8- int flag;
9+ int flag= 0;
10 uint32_t totlength,nod_flag,not_used[2];
11
12 totlength=keyinfo->keylength+(nod_flag=mi_test_if_nod(page));
13@@ -234,7 +234,7 @@
14 unsigned char *key, uint32_t key_len, uint32_t comp_flag, unsigned char **ret_pos,
15 unsigned char *buff, bool *last_key)
16 {
17- int flag=0;
18+ int flag= 0;
19 uint32_t nod_flag,length=0,not_used[2];
20 unsigned char t_buff[MI_MAX_KEY_BUFF],*end;
21