|
From: Crossfire C. r. messages.
<cro...@li...> - 2009-10-24 21:23:40
|
Revision: 12218
http://crossfire.svn.sourceforge.net/crossfire/?rev=12218&view=rev
Author: akirschbaum
Date: 2009-10-24 21:23:30 +0000 (Sat, 24 Oct 2009)
Log Message:
-----------
Remove type casts removing 'const' qualifiers.
Modified Paths:
--------------
server/trunk/common/object.c
server/trunk/include/global.h
server/trunk/include/map.h
server/trunk/socket/info.c
Modified: server/trunk/common/object.c
===================================================================
--- server/trunk/common/object.c 2009-10-24 20:56:28 UTC (rev 12217)
+++ server/trunk/common/object.c 2009-10-24 21:23:30 UTC (rev 12218)
@@ -3192,7 +3192,7 @@
/* If radius is not set, default to 1 */
value = object_get_value(gen, "generator_radius");
if (value) {
- radius = (sint8)strtol((char *)value, NULL, 10);
+ radius = (sint8)strtol(value, NULL, 10);
if (radius < 1) {
radius = 1;
}
Modified: server/trunk/include/global.h
===================================================================
--- server/trunk/include/global.h 2009-10-24 20:56:28 UTC (rev 12217)
+++ server/trunk/include/global.h 2009-10-24 21:23:30 UTC (rev 12218)
@@ -285,7 +285,7 @@
* This is generally done as a safety, and having this macro
* makes the code a bit cleaner when doing so.
*/
-#define FREE_AND_CLEAR(xyz) { free((void *)xyz); xyz = NULL; }
+#define FREE_AND_CLEAR(xyz) { free(xyz); xyz = NULL; }
#define FREE_AND_CLEAR_STR(xyz) { free_string(xyz); xyz = NULL; }
/* FREE_AND_COPY is for the shared string - it is handy enough
Modified: server/trunk/include/map.h
===================================================================
--- server/trunk/include/map.h 2009-10-24 20:56:28 UTC (rev 12217)
+++ server/trunk/include/map.h 2009-10-24 21:23:30 UTC (rev 12218)
@@ -294,8 +294,8 @@
*/
typedef struct regiondef {
struct regiondef *next; /**< Pointer to next region, NULL for the last one */
- const char *name; /**< Shortend name of the region as maps refer to it */
- const char *parent_name; /**<
+ char *name; /**< Shortend name of the region as maps refer to it */
+ char *parent_name; /**<
* So that parent and child regions can be defined in
* any order, we keep hold of the parent_name during
* initialisation, and the children get assigned to their
@@ -307,9 +307,9 @@
* region, if a value isn't defined in the current region
* we traverse this series of pointers until it is.
*/
- const char *longname; /**< Official title of the region, this might be defined
+ char *longname; /**< Official title of the region, this might be defined
* to be the same as name*/
- const char *msg; /**< The description of the region */
+ char *msg; /**< The description of the region */
uint32 counter; /**< A generic counter for holding temporary data. */
sint8 fallback; /**< Whether, in the event of a region not existing,
* this should be the one we fall back on as the default. */
Modified: server/trunk/socket/info.c
===================================================================
--- server/trunk/socket/info.c 2009-10-24 20:56:28 UTC (rev 12217)
+++ server/trunk/socket/info.c 2009-10-24 21:23:30 UTC (rev 12218)
@@ -155,9 +155,11 @@
*/
if (!CLIENT_SUPPORT_READABLES(&pl->contr->socket, type)) {
char *buf;
+ const char *buf2;
if (oldmessage) {
- buf = (char *)oldmessage;
+ buf2 = oldmessage;
+ buf = NULL;
} else {
buf = strdup_local(message);
if (buf == NULL) {
@@ -165,10 +167,10 @@
return;
}
strip_media_tag(buf);
+ buf2 = buf;
}
- print_message(flags&NDI_COLOR_MASK, pl, buf);
- if (!oldmessage)
- free(buf);
+ print_message(flags&NDI_COLOR_MASK, pl, buf2);
+ free(buf);
} else {
esrv_print_ext_msg(&pl->contr->socket, flags&NDI_COLOR_MASK, type, subtype, message);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|