Re: [AD] Figuring out the language from the environment variable LANG |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> I always forget about 'its'. Let's see this variation:
>
> install_allegro automatically calls this function, and if you have an
> environment variable named LANG, its first two letters will be used to
> set the system language.
Fine with me.
> > + char lang[3] = "en";
> >
> > Kill the "3".
>
> Any particular reason? Specifying size is safer and -pedantic
> allows it.
Safer !????? How much time do you need to evaluate whether the following
declaration is correct ? (And is it correct?)
char s[26] = "this_is_a_very_long_string";
The C compiler computes the right length in 100 ns and is never wrong.
> > + /* yes, this is bad, but we only read the first two letters */
> >
> > "two first letters".
>
> Hehe, letters firts two say would yoda. I trust Ben, his domain
> name ends with .uk, and they have Rowan Atkinson.
Ben's call indeed. But note that your patch contained both variants, so I
simply pointed out that a bit of consistency was needed. Not my lucky day:-)
> > + AL_CONST char *ext, *datafile;
> > + char filename[1024], *namecpy = ustrdup(name);
> >
> > Don't mix char[] and char* variables.
>
> Why? It's funny...
I should have said: don't declare variables with different types on the same
line.
--
Eric Botcazou