avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcrea...@apache.org
Subject svn commit: r1213895 - in /avro/trunk: CHANGES.txt lang/c/src/avro/generic.h lang/c/src/avro/value.h lang/c/src/datum_value.c lang/c/src/generic.c lang/c/src/resolved-reader.c lang/c/src/resolved-writer.c
Date Tue, 13 Dec 2011 19:44:38 GMT
Author: dcreager
Date: Tue Dec 13 19:44:37 2011
New Revision: 1213895

URL: http://svn.apache.org/viewvc?rev=1213895&view=rev
Log:
AVRO-960. C: const char parameters for set_string and set_string_len

The avro_value_set_string and avro_value_set_string_len input parameters
are now "const char *" instead of "char *".  This is change is backwards
compatible, since everything that compiled previously will still compile
without errors or warnings.  Contributed by Lucas Martin-King.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/c/src/avro/generic.h
    avro/trunk/lang/c/src/avro/value.h
    avro/trunk/lang/c/src/datum_value.c
    avro/trunk/lang/c/src/generic.c
    avro/trunk/lang/c/src/resolved-reader.c
    avro/trunk/lang/c/src/resolved-writer.c

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1213895&r1=1213894&r2=1213895&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Tue Dec 13 19:44:37 2011
@@ -26,6 +26,10 @@ Avro 1.6.2 (unreleased)
     ExecutionHandler, to handle multiple requests simultaneously.
     (Bruno Dumon via cutting)
 
+    AVRO-960. C: avro_value_set_string and avro_value_set_string_len
+    input parameters are now "const char *" instead of "char *".
+    (Lucas Martin-King via dcreager)
+
   BUG FIXES
 
     AVRO-962. Java: Fix Maven plugin to support string type override.

Modified: avro/trunk/lang/c/src/avro/generic.h
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/avro/generic.h?rev=1213895&r1=1213894&r2=1213895&view=diff
==============================================================================
--- avro/trunk/lang/c/src/avro/generic.h (original)
+++ avro/trunk/lang/c/src/avro/generic.h Tue Dec 13 19:44:37 2011
@@ -80,8 +80,8 @@ int avro_generic_float_new(avro_value_t 
 int avro_generic_int_new(avro_value_t *value, int32_t val);
 int avro_generic_long_new(avro_value_t *value, int64_t val);
 int avro_generic_null_new(avro_value_t *value);
-int avro_generic_string_new(avro_value_t *value, char *val);
-int avro_generic_string_new_length(avro_value_t *value, char *val, size_t size);
+int avro_generic_string_new(avro_value_t *value, const char *val);
+int avro_generic_string_new_length(avro_value_t *value, const char *val, size_t size);
 
 
 CLOSE_EXTERN

Modified: avro/trunk/lang/c/src/avro/value.h
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/avro/value.h?rev=1213895&r1=1213894&r2=1213895&view=diff
==============================================================================
--- avro/trunk/lang/c/src/avro/value.h (original)
+++ avro/trunk/lang/c/src/avro/value.h Tue Dec 13 19:44:37 2011
@@ -181,10 +181,10 @@ struct avro_value_iface {
 	int (*set_null)(const avro_value_iface_t *iface, void *self);
 	/* The input must be NUL-terminated */
 	int (*set_string)(const avro_value_iface_t *iface,
-			  void *self, char *str);
+			  void *self, const char *str);
 	/* and size must INCLUDE the NUL terminator */
 	int (*set_string_len)(const avro_value_iface_t *iface,
-			      void *self, char *str, size_t size);
+			      void *self, const char *str, size_t size);
 	int (*give_string_len)(const avro_value_iface_t *iface,
 			       void *self, avro_wrapped_buffer_t *buf);
 

Modified: avro/trunk/lang/c/src/datum_value.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/datum_value.c?rev=1213895&r1=1213894&r2=1213895&view=diff
==============================================================================
--- avro/trunk/lang/c/src/datum_value.c (original)
+++ avro/trunk/lang/c/src/datum_value.c Tue Dec 13 19:44:37 2011
@@ -393,7 +393,7 @@ avro_datum_value_set_null(const avro_val
 
 static int
 avro_datum_value_set_string(const avro_value_iface_t *iface,
-			    void *vself, char *str)
+			    void *vself, const char *str)
 {
 	AVRO_UNUSED(iface);
 	avro_datum_t  self = vself;
@@ -403,7 +403,7 @@ avro_datum_value_set_string(const avro_v
 
 static int
 avro_datum_value_set_string_len(const avro_value_iface_t *iface,
-				void *vself, char *str, size_t size)
+				void *vself, const char *str, size_t size)
 {
 	AVRO_UNUSED(iface);
 	AVRO_UNUSED(size);

Modified: avro/trunk/lang/c/src/generic.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/generic.c?rev=1213895&r1=1213894&r2=1213895&view=diff
==============================================================================
--- avro/trunk/lang/c/src/generic.c (original)
+++ avro/trunk/lang/c/src/generic.c Tue Dec 13 19:44:37 2011
@@ -402,7 +402,7 @@ avro_generic_link_set_null(const avro_va
 
 static int
 avro_generic_link_set_string(const avro_value_iface_t *iface,
-			     void *vself, char *str)
+			     void *vself, const char *str)
 {
 	AVRO_UNUSED(iface);
 	avro_value_t  *self = vself;
@@ -411,7 +411,7 @@ avro_generic_link_set_string(const avro_
 
 static int
 avro_generic_link_set_string_len(const avro_value_iface_t *iface,
-				 void *vself, char *str, size_t size)
+				 void *vself, const char *str, size_t size)
 {
 	AVRO_UNUSED(iface);
 	avro_value_t  *self = vself;
@@ -1750,7 +1750,7 @@ avro_generic_string_grab(const avro_valu
 
 static int
 avro_generic_string_set(const avro_value_iface_t *iface,
-			void *vself, char *val)
+			void *vself, const char *val)
 {
 	AVRO_UNUSED(iface);
 	check_param(EINVAL, val != NULL, "string contents");
@@ -1767,7 +1767,7 @@ avro_generic_string_set(const avro_value
 
 static int
 avro_generic_string_set_length(const avro_value_iface_t *iface,
-			       void *vself, char *val, size_t size)
+			       void *vself, const char *val, size_t size)
 {
 	AVRO_UNUSED(iface);
 	check_param(EINVAL, val != NULL, "string contents");
@@ -1874,7 +1874,7 @@ avro_generic_string_class(void)
 }
 
 int
-avro_generic_string_new(avro_value_t *value, char *str)
+avro_generic_string_new(avro_value_t *value, const char *str)
 {
 	int  rval;
 	check(rval, avro_generic_value_new(&AVRO_GENERIC_STRING_CLASS.parent, value));
@@ -1882,7 +1882,7 @@ avro_generic_string_new(avro_value_t *va
 }
 
 int
-avro_generic_string_new_length(avro_value_t *value, char *str, size_t size)
+avro_generic_string_new_length(avro_value_t *value, const char *str, size_t size)
 {
 	int  rval;
 	check(rval, avro_generic_value_new(&AVRO_GENERIC_STRING_CLASS.parent, value));

Modified: avro/trunk/lang/c/src/resolved-reader.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/resolved-reader.c?rev=1213895&r1=1213894&r2=1213895&view=diff
==============================================================================
--- avro/trunk/lang/c/src/resolved-reader.c (original)
+++ avro/trunk/lang/c/src/resolved-reader.c Tue Dec 13 19:44:37 2011
@@ -714,7 +714,7 @@ avro_resolved_link_reader_set_null(const
 
 static int
 avro_resolved_link_reader_set_string(const avro_value_iface_t *iface,
-				     void *vself, char *str)
+				     void *vself, const char *str)
 {
 	AVRO_UNUSED(iface);
 	avro_resolved_link_value_t  *self = vself;
@@ -725,7 +725,7 @@ avro_resolved_link_reader_set_string(con
 
 static int
 avro_resolved_link_reader_set_string_len(const avro_value_iface_t *iface,
-					 void *vself, char *str, size_t size)
+					 void *vself, const char *str, size_t size)
 {
 	AVRO_UNUSED(iface);
 	avro_resolved_link_value_t  *self = vself;
@@ -2721,7 +2721,7 @@ avro_resolved_wunion_reader_set_null(con
 
 static int
 avro_resolved_wunion_reader_set_string(const avro_value_iface_t *viface,
-				       void *vself, char *str)
+				       void *vself, const char *str)
 {
 	int  rval;
 	avro_value_t  src;
@@ -2731,7 +2731,7 @@ avro_resolved_wunion_reader_set_string(c
 
 static int
 avro_resolved_wunion_reader_set_string_len(const avro_value_iface_t *viface,
-					   void *vself, char *str, size_t size)
+					   void *vself, const char *str, size_t size)
 {
 	int  rval;
 	avro_value_t  src;

Modified: avro/trunk/lang/c/src/resolved-writer.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/resolved-writer.c?rev=1213895&r1=1213894&r2=1213895&view=diff
==============================================================================
--- avro/trunk/lang/c/src/resolved-writer.c (original)
+++ avro/trunk/lang/c/src/resolved-writer.c Tue Dec 13 19:44:37 2011
@@ -843,7 +843,7 @@ avro_resolved_link_writer_set_null(const
 
 static int
 avro_resolved_link_writer_set_string(const avro_value_iface_t *iface,
-				     void *vself, char *str)
+				     void *vself, const char *str)
 {
 	AVRO_UNUSED(iface);
 	avro_resolved_link_value_t  *self = vself;
@@ -854,7 +854,7 @@ avro_resolved_link_writer_set_string(con
 
 static int
 avro_resolved_link_writer_set_string_len(const avro_value_iface_t *iface,
-					 void *vself, char *str, size_t size)
+					 void *vself, const char *str, size_t size)
 {
 	AVRO_UNUSED(iface);
 	avro_resolved_link_value_t  *self = vself;
@@ -1475,7 +1475,7 @@ try_null(memoize_state_t *state, avro_re
 
 static int
 avro_resolved_writer_set_string(const avro_value_iface_t *viface,
-				void *vself, char *str)
+				void *vself, const char *str)
 {
 	int  rval;
 	const avro_resolved_writer_t  *iface =
@@ -1489,7 +1489,7 @@ avro_resolved_writer_set_string(const av
 
 static int
 avro_resolved_writer_set_string_len(const avro_value_iface_t *viface,
-				    void *vself, char *str, size_t size)
+				    void *vself, const char *str, size_t size)
 {
 	int  rval;
 	const avro_resolved_writer_t  *iface =



Mime
View raw message