[1827] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[nelhage/barnowl] 68f358: owl_new_sv: Small const fix.

daemon@ATHENA.MIT.EDU (noreply@github.com)
Thu Oct 29 18:22:49 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
X-Original-To: nelhage@lunatique.mit.edu
Date: Mon, 19 Oct 2009 22:30:00 -0700
To: barnowl-dev@mit.edu
From: noreply@github.com

Branch: refs/heads/master
Home:   http://github.com/nelhage/barnowl

Commit: 68f358cfe28c85474e90e129c5e96645d5b86963
    http://github.com/nelhage/barnowl/commit/68f358cfe28c85474e90e129c5e96645d5b86963
Author: Anders Kaseorg <andersk@mit.edu>
Date:   2009-10-19 (Mon, 19 Oct 2009)

Changed paths:
  M perlconfig.c

Log Message:
-----------
owl_new_sv: Small const fix.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>


Commit: 6337cb5742f397a3db9201557de56be05c9394a1
    http://github.com/nelhage/barnowl/commit/6337cb5742f397a3db9201557de56be05c9394a1
Author: Anders Kaseorg <andersk@mit.edu>
Date:   2009-10-19 (Mon, 19 Oct 2009)

Changed paths:
  M owl.h

Log Message:
-----------
Reimplement zstr with a union, to shut up gcc -Wcast-qual.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>


Commit: 99525be7e6268ba595d424f7f84e31716765f1fc
    http://github.com/nelhage/barnowl/commit/99525be7e6268ba595d424f7f84e31716765f1fc
Author: Anders Kaseorg <andersk@mit.edu>
Date:   2009-10-19 (Mon, 19 Oct 2009)

Changed paths:
  M cmd.c
  M variable.c

Log Message:
-----------
Use strtol without casting, to shut up gcc -Wcast-qual.

strtol should really have been two functions with types

  long int strtol(char *nptr, char **endptr, int base);
  long int strtol(const char *nptr, const char **endptr, int base);

but C doesn’t have overloading, so the real strtol has make a small
type safety compromise:

  long int strtol(const char *nptr, char **endptr, int base);

Such a compromise would be invisible in the return type (as it is with
char *strchr(const char *s, int c)), because char * may be implicitly
casted back to const char *.  But here char **endptr is an output
pointer argument, and we can’t pass it the address of a const char *.

Initially I rejected that compromise by casting endptr from the
address of a const char *.  But that makes gcc -Wcast-qual emit an
unnecessary warning, so let’s just use a char * instead.

</rant>

Signed-off-by: Anders Kaseorg <andersk@mit.edu>



home help back first fref pref prev next nref lref last post