avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mas...@apache.org
Subject svn commit: r919570 - in /hadoop/avro/trunk: ./ lang/c/examples/ lang/c/src/ lang/c/tests/
Date Fri, 05 Mar 2010 19:50:32 GMT
Author: massie
Date: Fri Mar  5 19:50:31 2010
New Revision: 919570

URL: http://svn.apache.org/viewvc?rev=919570&view=rev
Log:
AVRO-453. More warning cleanup. Contributed by Bruce Mitchener.

Modified:
    hadoop/avro/trunk/CHANGES.txt
    hadoop/avro/trunk/lang/c/examples/quickstop.c
    hadoop/avro/trunk/lang/c/src/avro_private.h
    hadoop/avro/trunk/lang/c/src/datum.c
    hadoop/avro/trunk/lang/c/src/datum_read.c
    hadoop/avro/trunk/lang/c/src/datum_size.c
    hadoop/avro/trunk/lang/c/src/datum_skip.c
    hadoop/avro/trunk/lang/c/src/datum_validate.c
    hadoop/avro/trunk/lang/c/src/datum_write.c
    hadoop/avro/trunk/lang/c/src/encoding_binary.c
    hadoop/avro/trunk/lang/c/src/schema.c
    hadoop/avro/trunk/lang/c/src/st.c
    hadoop/avro/trunk/lang/c/tests/test_avro_data.c
    hadoop/avro/trunk/lang/c/tests/test_avro_schema.c

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Fri Mar  5 19:50:31 2010
@@ -32,6 +32,8 @@
 
     AVRO-452. Include cleanup (Bruce Mitchener via massie)
 
+    AVRO-453. More warning cleanup (Bruce Mitchener via massie)
+
   BUG FIXES
 
     AVRO-424. Fix the specification of the deflate codec.

Modified: hadoop/avro/trunk/lang/c/examples/quickstop.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/examples/quickstop.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/examples/quickstop.c (original)
+++ hadoop/avro/trunk/lang/c/examples/quickstop.c Fri Mar  5 19:50:31 2010
@@ -81,7 +81,7 @@
 	avro_datum_decref(phone_datum);
 	avro_datum_decref(person);
 
-	fprintf(stdout, "Successfully added %s, %s id=%ld\n", last, first, id);
+	fprintf(stdout, "Successfully added %s, %s id=%lld\n", last, first, id);
 }
 
 int print_person(avro_file_reader_t db, avro_schema_t reader_schema)
@@ -99,7 +99,7 @@
 
 		if (avro_record_get(person, "ID", &id_datum) == 0) {
 			avro_int64_get(id_datum, &i64);
-			fprintf(stdout, "%ld | ", i64);
+			fprintf(stdout, "%lld | ", i64);
 		}
 		if (avro_record_get(person, "First", &first_datum) == 0) {
 			avro_string_get(first_datum, &p);

Modified: hadoop/avro/trunk/lang/c/src/avro_private.h
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/avro_private.h?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/avro_private.h (original)
+++ hadoop/avro/trunk/lang/c/src/avro_private.h Fri Mar  5 19:50:31 2010
@@ -21,6 +21,8 @@
 
 #define check(rval, call) { rval = call; if(rval) return rval; }
 
+#define AVRO_UNUSED(var) (void)var;
+
 #define container_of(ptr_, type_, member_)  \
     ((type_ *)((char *)ptr_ - (size_t)&((type_ *)0)->member_))
 

Modified: hadoop/avro/trunk/lang/c/src/datum.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/datum.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/datum.c (original)
+++ hadoop/avro/trunk/lang/c/src/datum.c Fri Mar  5 19:50:31 2010
@@ -156,6 +156,8 @@
 {
 	struct avro_bytes_datum_t *b;
 
+	AVRO_UNUSED(size);
+
 	if (!(is_avro_datum(datum) && is_avro_bytes(datum))) {
 		return EINVAL;
 	}
@@ -547,6 +549,8 @@
 {
 	struct avro_fixed_datum_t *fixed;
 
+	AVRO_UNUSED(size);
+
 	if (!(is_avro_datum(datum) && is_avro_fixed(datum))) {
 		return EINVAL;
 	}
@@ -698,6 +702,8 @@
 
 static int char_datum_free_foreach(char *key, avro_datum_t datum, void *arg)
 {
+	AVRO_UNUSED(arg);
+
 	avro_datum_decref(datum);
 	free(key);
 	return ST_DELETE;
@@ -705,6 +711,9 @@
 
 static int array_free_foreach(int i, avro_datum_t datum, void *arg)
 {
+	AVRO_UNUSED(i);
+	AVRO_UNUSED(arg);
+
 	avro_datum_decref(datum);
 	return ST_DELETE;
 }
@@ -846,5 +855,6 @@
 
 void avro_datum_print(avro_datum_t value, FILE * fp)
 {
-
+	AVRO_UNUSED(value);
+	AVRO_UNUSED(fp);
 }

Modified: hadoop/avro/trunk/lang/c/src/datum_read.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/datum_read.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/datum_read.c (original)
+++ hadoop/avro/trunk/lang/c/src/datum_read.c Fri Mar  5 19:50:31 2010
@@ -102,6 +102,8 @@
 	int rval;
 	int64_t index;
 
+	AVRO_UNUSED(readers_schema);
+
 	check(rval, enc->read_long(reader, &index));
 	*datum = avro_enum(writers_schema->name, index);
 	return 0;
@@ -227,6 +229,9 @@
 		st_data_t data;
 		avro_schema_t schema;
 	} val;
+
+	AVRO_UNUSED(readers_schema);
+
 	check(rval, enc->read_long(reader, &discriminant));
 	if (!st_lookup(writers_schema->branches, discriminant, &val.data)) {
 		return EILSEQ;
@@ -248,6 +253,8 @@
 	avro_datum_t record;
 	avro_datum_t field_datum;
 
+	AVRO_UNUSED(enc);
+
 	record = *datum =
 	    avro_record(writers_schema->name, writers_schema->space);
 	for (i = 0; i < writers_schema->fields->num_entries; i++) {

Modified: hadoop/avro/trunk/lang/c/src/datum_size.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/datum_size.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/datum_size.c (original)
+++ hadoop/avro/trunk/lang/c/src/datum_size.c Fri Mar  5 19:50:31 2010
@@ -77,6 +77,8 @@
 size_enum(avro_writer_t writer, const avro_encoding_t * enc,
 	  struct avro_enum_schema_t *enump, struct avro_enum_datum_t *datum)
 {
+	AVRO_UNUSED(enump);
+
 	return enc->size_long(writer, datum->value);
 }
 

Modified: hadoop/avro/trunk/lang/c/src/datum_skip.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/datum_skip.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/datum_skip.c (original)
+++ hadoop/avro/trunk/lang/c/src/datum_skip.c Fri Mar  5 19:50:31 2010
@@ -125,6 +125,8 @@
 	int rval;
 	long i;
 
+	AVRO_UNUSED(enc);
+
 	for (i = 0; i < writers_schema->fields->num_entries; i++) {
 		union {
 			st_data_t data;

Modified: hadoop/avro/trunk/lang/c/src/datum_validate.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/datum_validate.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/datum_validate.c (original)
+++ hadoop/avro/trunk/lang/c/src/datum_validate.c Fri Mar  5 19:50:31 2010
@@ -32,6 +32,8 @@
 schema_map_validate_foreach(char *key, avro_datum_t datum,
 			    struct validate_st *vst)
 {
+	AVRO_UNUSED(key);
+
 	if (!avro_schema_datum_validate(vst->expected_schema, datum)) {
 		vst->rval = 0;
 		return ST_STOP;

Modified: hadoop/avro/trunk/lang/c/src/datum_write.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/datum_write.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/datum_write.c (original)
+++ hadoop/avro/trunk/lang/c/src/datum_write.c Fri Mar  5 19:50:31 2010
@@ -71,6 +71,8 @@
 write_enum(avro_writer_t writer, const avro_encoding_t * enc,
 	   struct avro_enum_schema_t *enump, struct avro_enum_datum_t *datum)
 {
+	AVRO_UNUSED(enump);
+
 	return enc->write_long(writer, datum->value);
 }
 

Modified: hadoop/avro/trunk/lang/c/src/encoding_binary.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/encoding_binary.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/encoding_binary.c (original)
+++ hadoop/avro/trunk/lang/c/src/encoding_binary.c Fri Mar  5 19:50:31 2010
@@ -77,6 +77,8 @@
 
 static int64_t size_long(avro_writer_t writer, int64_t l)
 {
+	AVRO_UNUSED(writer);
+
 	int64_t len = 0;
 	uint64_t n = (l << 1) ^ (l >> 63);
 	while (n & ~0x7F) {
@@ -162,6 +164,8 @@
 static int64_t
 size_bytes(avro_writer_t writer, const char *bytes, const int64_t len)
 {
+	AVRO_UNUSED(bytes);
+
 	return size_long(writer, len) + len;
 }
 
@@ -240,6 +244,9 @@
 
 static int64_t size_float(avro_writer_t writer, const float f)
 {
+	AVRO_UNUSED(writer);
+	AVRO_UNUSED(f);
+
 	return 4;
 }
 
@@ -304,6 +311,9 @@
 
 static int64_t size_double(avro_writer_t writer, const double d)
 {
+	AVRO_UNUSED(writer);
+	AVRO_UNUSED(d);
+
 	return 8;
 }
 
@@ -327,6 +337,9 @@
 
 static int64_t size_boolean(avro_writer_t writer, const int8_t b)
 {
+	AVRO_UNUSED(writer);
+	AVRO_UNUSED(b);
+
 	return 1;
 }
 
@@ -335,6 +348,8 @@
 	/*
 	 * no-op 
 	 */
+	AVRO_UNUSED(reader);
+
 	return 0;
 }
 
@@ -343,11 +358,15 @@
 	/*
 	 * no-op 
 	 */
+	AVRO_UNUSED(writer);
+
 	return 0;
 }
 
 static int64_t size_null(avro_writer_t writer)
 {
+	AVRO_UNUSED(writer);
+
 	return 0;
 }
 

Modified: hadoop/avro/trunk/lang/c/src/schema.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/schema.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/schema.c (original)
+++ hadoop/avro/trunk/lang/c/src/schema.c Fri Mar  5 19:50:31 2010
@@ -64,6 +64,9 @@
 static int record_free_foreach(int i, struct avro_record_field_t *field,
 			       void *arg)
 {
+	AVRO_UNUSED(i);
+	AVRO_UNUSED(arg);
+
 	free(field->name);
 	avro_schema_decref(field->type);
 	free(field);
@@ -72,12 +75,18 @@
 
 static int enum_free_foreach(int i, char *sym, void *arg)
 {
+	AVRO_UNUSED(i);
+	AVRO_UNUSED(arg);
+
 	free(sym);
 	return ST_DELETE;
 }
 
 static int union_free_foreach(int i, avro_schema_t schema, void *arg)
 {
+	AVRO_UNUSED(i);
+	AVRO_UNUSED(arg);
+
 	avro_schema_decref(schema);
 	return ST_DELETE;
 }
@@ -833,6 +842,8 @@
 	int rval = 0;
 	struct avro_schema_error_t *error;
 
+	AVRO_UNUSED(len);
+
 	if (!jsontext || !schema) {
 		return EINVAL;
 	}

Modified: hadoop/avro/trunk/lang/c/src/st.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/src/st.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/src/st.c (original)
+++ hadoop/avro/trunk/lang/c/src/st.c Fri Mar  5 19:50:31 2010
@@ -451,6 +451,8 @@
 static int delete_never(key, value, never)
 st_data_t key, value, never;
 {
+	AVRO_UNUSED(key);
+
 	if (value == never)
 		return ST_DELETE;
 	return ST_CONTINUE;

Modified: hadoop/avro/trunk/lang/c/tests/test_avro_data.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/tests/test_avro_data.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/tests/test_avro_data.c (original)
+++ hadoop/avro/trunk/lang/c/tests/test_avro_data.c Fri Mar  5 19:50:31 2010
@@ -98,7 +98,7 @@
 
 static int test_string(void)
 {
-	int i;
+	unsigned int i;
 	const char *strings[] = { "Four score and seven years ago",
 		"our father brought forth on this continent",
 		"a new nation", "conceived in Liberty",
@@ -321,7 +321,7 @@
 
 int main(void)
 {
-	int i;
+	unsigned int i;
 	struct avro_tests {
 		char *name;
 		avro_test func;

Modified: hadoop/avro/trunk/lang/c/tests/test_avro_schema.c
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/c/tests/test_avro_schema.c?rev=919570&r1=919569&r2=919570&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/c/tests/test_avro_schema.c (original)
+++ hadoop/avro/trunk/lang/c/tests/test_avro_schema.c Fri Mar  5 19:50:31 2010
@@ -102,6 +102,9 @@
 	char *srcdir = getenv("srcdir");
 	char path[1024];
 
+	AVRO_UNUSED(argc);
+	AVRO_UNUSED(argv);
+
 	if (!srcdir) {
 		srcdir = ".";
 	}



Mime
View raw message