[brlcad-commits] SF.net SVN: brlcad:[54093] brlcad/trunk/include
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2012-12-19 23:25:35
|
Revision: 54093 http://brlcad.svn.sourceforge.net/brlcad/?rev=54093&view=rev Author: brlcad Date: 2012-12-19 23:25:25 +0000 (Wed, 19 Dec 2012) Log Message: ----------- gcc notices en masse that we assign string literals to non-const struct elements. fixed by adding const qualifier. undoubtedly will need to propagate constness elsewhere too. Modified Paths: -------------- brlcad/trunk/include/bu.h brlcad/trunk/include/raytrace.h Modified: brlcad/trunk/include/bu.h =================================================================== --- brlcad/trunk/include/bu.h 2012-12-19 20:36:51 UTC (rev 54092) +++ brlcad/trunk/include/bu.h 2012-12-19 23:25:25 UTC (rev 54093) @@ -2182,12 +2182,12 @@ * probably shouldn't use this technique. */ struct bu_structparse { - char sp_fmt[4]; /**< "%i" or "%f", etc. */ + const char sp_fmt[4]; /**< "%i" or "%f", etc. */ size_t sp_count; /**< number of elements */ - char *sp_name; /**< Element's symbolic name */ + const char *sp_name; /**< Element's symbolic name */ size_t sp_offset; /**< Byte offset in struct */ void (*sp_hook)(); /**< Optional hooked function, or indir ptr */ - char *sp_desc; /**< description of element */ + const char *sp_desc; /**< description of element */ void *sp_default; /**< ptr to default value */ }; typedef struct bu_structparse bu_structparse_t; Modified: brlcad/trunk/include/raytrace.h =================================================================== --- brlcad/trunk/include/raytrace.h 2012-12-19 20:36:51 UTC (rev 54092) +++ brlcad/trunk/include/raytrace.h 2012-12-19 23:25:25 UTC (rev 54093) @@ -1632,7 +1632,7 @@ int a_level; /**< @brief recursion level (for printing) */ int a_x; /**< @brief Screen X of ray, if applicable */ int a_y; /**< @brief Screen Y of ray, if applicable */ - char * a_purpose; /**< @brief Debug string: purpose of ray */ + const char * a_purpose; /**< @brief Debug string: purpose of ray */ fastf_t a_rbeam; /**< @brief initial beam radius (mm) */ fastf_t a_diverge; /**< @brief slope of beam divergence/mm */ int a_return; /**< @brief Return of a_hit()/a_miss() */ @@ -1923,9 +1923,9 @@ * Table for driving generic command-parsing routines */ struct command_tab { - char *ct_cmd; - char *ct_parms; - char *ct_comment; + const char *ct_cmd; + const char *ct_parms; + const char *ct_comment; int (*ct_func)(); int ct_min; /**< @brief min number of words in cmd */ int ct_max; /**< @brief max number of words in cmd */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |