[ovs-dev] [PATCH 1/3] util: Store version in global "program_version" string.

Justin Pettit jpettit at nicira.com
Thu Aug 4 18:03:28 UTC 2011


On Aug 4, 2011, at 9:31 AM, Ben Pfaff wrote:

> Please insert a line break between "void" and "set_program_name".  I
> guess this style bug is very old.

Updated.

> You can delete the "if" test here, since free(NULL) is a no-op:
>> +    if (program_version) {
>> +        free(program_version);
>> +    }

Good point.

> I think I'd rather have program_version be static and add a
> get_program_version() accessor function.

I was following the "program_name" convention, but I agree this is better.

> For some reason the all-caps SET_PROGRAM_NAME bothers me.  Maybe the
> macro could be set_program_name and the function behind it
> set_program_name__()?  This would also require fewer changes to other
> files.  But it is not important, if you don't like that idea.

I agree that's better.  Updated.

--Justin





More information about the dev mailing list