Diego 'Flameeyes' Pettenò [EMAIL PROTECTED] writes:
It is a micro-optimisation, I admit that, but it's not just the
indirection the problem.
Pointers, and structures containing pointers, need to be
runtime-relocated for shared libraries and PIC code (let's assume
that shared libraries are
Diego 'Flameeyes' Pettenò [EMAIL PROTECTED] writes:
On 01/feb/08, at 09:12, Hrvoje Niksic wrote:
Even ignoring the fact that Wget is not a shared library, there are
ways to solve this problem other than turning all char *foo[] into
char foo[][MAXSIZE], which is, sorry, just lame and wasteful
On 01/feb/08, at 09:12, Hrvoje Niksic wrote:
Even ignoring the fact that Wget is not a shared library, there are
ways to solve this problem other than turning all char *foo[] into
char foo[][MAXSIZE], which is, sorry, just lame and wasteful in all
but the most trivial examples.
That's why I
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hrvoje Niksic wrote:
Of course, the changes that introduce const without compromising
maintainability, such as the constification of the Wp declaration in
ftp-opie.c, are more than welcome.
Indeed. In fact, even if Diego doesn't submit a patch
Micah Cowan [EMAIL PROTECTED] writes:
Note that you could also do all the pointer maths up-front, leaving
existing usage code the same, with something like:
static const char foo_data[] = one\0two\0three;
static const char * const foo = {foo_data + 0, foo_data + 4,
foo_data + 8};
I
Micah Cowan [EMAIL PROTECTED] writes:
Right. What I was meaning to prevent, though, is the need to do:
foo[foo_data + foo_idx[i]]
and instead do:
foo[i]
That is why my example had a foo function, which turns foo[i] to
foo(i), but otherwise works the same. Using just foo[i] is
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
(Forgot to CC the list.
Also, my mailer seems to be screwing up the quotes. :( -M)
Diego 'Flameeyes' Pettenò wrote:
| As for maintainability, while a character pointer is easier to handle
than a
| character array, modern compilers warns you if you
On Friday 01 February 2008, you wrote:
Yes; but I still have to manually increment the size to an appropriate
value each time I add a bigger string; plus I'm wasting space for all
shorter strings (which applies more to bigger-than-two-element char
arrays);
Actually, you're not always. The
On Jan 31, 2008 8:21 PM, Diego 'Flameeyes' Pettenò [EMAIL PROTECTED] wrote:
char *foo = ab - 4 + 3 = 9 bytes
How did you get 9?
On 01/feb/08, at 02:33, Josh Williams wrote:
How did you get 9?
Probably by being 2:21 AM here ;) Sorry just a thinko.
10 matches
Mail list logo