Code review comment for lp:~vjsamuel/drizzle/fix-casts-drizzle-client

Revision history for this message
Olaf van der Spek (olafvdspek) wrote :

Nice work, but some comments:

On Wed, Feb 23, 2011 at 7:17 PM, Vijay Samuel <email address hidden> wrote:
> -  tmp= (char *) getenv("DRIZZLE_HOST");
> +  tmp= const_cast<char *>(getenv("DRIZZLE_HOST"));

Why? Can't tmp be made const char*?

> -  if (!((char*) (pagpoint)))
> +  if (!(const_cast<char *>((pagpoint))))

Why? pagpoint is already non-const.

> -      len=(uint32_t) (end - name);
> +      len=static_cast<uint32_t>((end - name));

len should probably be size_t so these casts aren't necessary.

> -  char *end_of_line=line+(uint32_t) strlen(line);
> +  char *end_of_line= line + static_cast<uint32_t>(strlen(line));

Why? It might be useful to check whether a cast is necessary in the first place.

Greetings,

Olaf

« Back to merge proposal