Really ccing the list :)
Jay Pipes wrote:
> cc'ing drizzle-discuss, as I think all plugin/module contributors will be
> interested in the answer to your question. :)
>
> Diego Medina wrote:
>> Hi Jay,
>>
>> I have a small question about the code, I saw a line that has
>>
>> errmsg_printf(ERRMSG_LVL_ERROR,
>> _("Failed to write full size of command. Tried to write
>> %" PRId64 " bytes at offset %" PRId64 ", but only wrote %" PRId64 " bytes.
>> Error: %s\n"),
>> sizeof(int64_t),
>> (int64_t) cur_offset,
>> (int64_t) written,
>> strerror(errno));
>>
>> and this comes from someone fairly new to c++
>>
>> Should (int64_t) cur_offset be written as int64_t (cur_offset)
>>
>> Unless I misunderstood the casting section from here
>> http://drizzle.org/wiki/Coding_Standards#Casting
>>
>> The only reason I noticed is because I saw a line on the unix_timestamp()
>> that also has a similar format.
>
> You are close! :) The code indeed does not conform to our Coding Standards
> (bad Jay!). The static_cast<>() template function should be used instead of
> C-style casts like the above.
>
> So, the above should be rewritten like this:
>
> errmsg_printf(ERRMSG_LVL_ERROR,
> _("Failed to write full size of command. Tried to write %"
> PRId64 " bytes at offset %" PRId64 ", but only wrote %" PRId64 " bytes.
> Error: %s\n"),
> sizeof(int64_t),
> static_cast<int64_t>(cur_offset),
> static_cast<int64_t>(written),
> strerror(errno));
>
> Cheers!
>
> Jay
--
Diego Medina
Web Developer
http://www.fmpwizard.com
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp