libopensc/log.h: minor 'esthetic' proposal

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

libopensc/log.h: minor 'esthetic' proposal

Tarasov Viktor
Hello,

will it be more appropriate to change the SC_FUNC_RETURN (and similar)
define
from:
#define SC_FUNC_RETURN(ctx, level, r) { \
...
}

to:
#define SC_FUNC_RETURN(ctx, level, r) do { \
...
} while(0)

Kind wishes,
Viktor.

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc-project.org/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: libopensc/log.h: minor 'esthetic' proposal

Nils Larsch
Tarasov Viktor wrote:

> Hello,
>
> will it be more appropriate to change the SC_FUNC_RETURN (and similar)
> define
> from:
> #define SC_FUNC_RETURN(ctx, level, r) { \
> ...
> }
>
> to:
> #define SC_FUNC_RETURN(ctx, level, r) do { \
> ...
> } while(0)

this will certainly improve the readability of the source
code as the macros are then threaded similar to functions
(the command ends with a ';').

Cheers,
Nils
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc-project.org/mailman/listinfo/opensc-devel