Re: [Freeciv-Dev] [PATCH] cosmetic fix at server/stdinhand.c
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Markus Linnala wrote:
>
> Instead of using 0 use H_NONE. Also use & instead of + as I think it
> is best choice when you are messing with bitfields.
>
> diff -u --ignore-space-change --recursive --new-file
> --exclude-from=.diffignore freeciv-cvs/server/stdinhand.c
> m/freeciv/server/stdinhand.c
> --- freeciv-cvs/server/stdinhand.c Sat Jun 12 15:03:32 1999
> +++ m/freeciv/server/stdinhand.c Sat Jul 3 15:55:12 1999
> @@ -775,9 +775,18 @@
> ***************************************************************/
> int handicap_of_skill_level(int level)
> {
> - int h[11] = { -1, 0, 0, H_RATES+H_TARGETS+H_HUTS,
> - 0, H_RATES+H_TARGETS+H_HUTS, 0, 0,
> - 0, 0, 0 };
> + int h[11] = { -1,
> + H_NONE,
> + H_NONE,
> + H_RATES & H_TARGETS & H_HUTS,
> + H_NONE,
> + H_RATES & H_TARGETS & H_HUTS,
> + H_NONE,
> + H_NONE,
> + H_NONE,
> + H_NONE,
> + H_NONE,
> + };
>
> assert(level>0 && level<=10);
> return h[level];
>
> --
> //Markus
This one is wrong. You should use the bar | instead of +.
--
Peter Schaefer - schaefer@xxxxxx, schaefer@xxxxxx
"Buy AMD processors or you will have to pay $4000 for the cheapest CPU in 2020"
|
|