Hello list,

(enriched mail, resent as the previous one apparently was lost due to my
using of a non-registered mail address)

The small issue I encountered with AG_Strcasestr could most probably be
easily
solved by having that function return 'const char *' instead of 'char *' in
agar/core/string_compat.h.

I made the change, rebuilt Agar flawlessly, and rebuilt user code as well,
without this time any problem.

Could this small change be integrated into upcoming versions of Agar? It
would
be convenient, as otherwise Agar will break any user code that includes
the Agar
header while using compilation flags a bit stricter than default ones.

Following patch seems to work just fine:

--- agar-1.3.4/core/string_compat.h 2009-06-22 04:58:28.000000000 +0200
+++ agar-1.3.4-improved/core/string_compat.h 2009-10-31
12:38:20.000000000 +0100
@@ -229,7 +229,7 @@
/*
* Locate a substring ignoring case.
*/
-static __inline__ char *
+static __inline__ const char *
AG_Strcasestr(const char *s, const char *find)
{
char c, sc;
@@ -246,7 +246,7 @@
} while (AG_Strncasecmp(s, find, len) != 0);
s--;
}
- return ((char *)s);
+ return s;
}
__END_DECLS


Here are some other (unrelated) suggestions:

    - add a demo making use of AG_InitVideoSDL and of a custom loop,
inspired from the tutorials?
    - document that functions like AG_InitCore return a result that can
be used that way (taken from the fixedres demo):

"""
    if (AG_InitCore("agar-fixedres-demo", 0) == -1) {
        fprintf(stderr, "%s\n", AG_GetError());
        return (1);
    }
"""
(since the API does not tell in the doc of these functions how to
interpret their result)
    - the AG_VERSION_ATLEAST macro in agar/core/version.h does not seem
to be able to compile, as AG_MAJOR_VERSION and al are not defined (maybe
wanting to specify AGAR_MAJOR_VERSION instead?)

Thanks,

Olivier Boudeville.

_______________________________________________
Agar mailing list
[email protected]
http://libagar.org/lists.html

Reply via email to