From: MARK CALLAGHAN Date: October 19 2009 3:07pm Subject: Re: Coding style changes of 2009-06-26 now in the guidelines List-Archive: http://lists.mysql.com/internals/37395 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Oct 19, 2009 at 12:01 AM, Ingo Str=FCwing = wrote: > Hi Mark, > > MARK CALLAGHAN, 17.10.2009 20:31: > > ... >> =A0 =A0 * =A0Functions should return zero on success, and non-zero on er= ror, >> so you can do: >> >> Can this be extended to state that these functions should return int >> rather than bool/my_bool? Some functions today use bool/my_bool and >> return TRUE on error. I have to read the code for these to figure out >> whether TRUE is returned on error. > > thanks for the suggestion. Is this a formal request to the MySQL Server > coding style government committee? > > http://forge.mysql.com/wiki/MySQL_Internals_Coding_Guidelines#How_we_main= tain_the_server_coding_guidelines > > In this case, please add, what the implementation strategy should be: > Change all existing code, or let only new code follow the proposal. I don't expect existing code to be changed. But it would be nice for people to slowly fix things when they edit code. My requests are: 1) Use Unix style for functions (return type is int, 0 =3D=3D success). The current rule doesn't mention the return type. Do not use bool/my_bool for this with FALSE=3D=3Derrror and TRUE=3D=3Dsuccess in place= of 1. 2) Use _Bool for my_bool on platforms that support C99 3) Do not use the literals 0 and 1 in place of FALSE and TRUE > > Regards > Ingo > -- > Ingo Str=FCwing, Database Group > Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten > Gesch=E4ftsf=FChrer: Thomas Schr=F6der, =A0 Wolfgang Engels, =A0 Wolf Fre= nkel > Vorsitzender des Aufsichtsrates: Martin H=E4ring =A0 HRB M=FCnchen 161028 > --=20 Mark Callaghan mdcallag@stripped