Updated Branches:
  refs/heads/master 4285ba29f -> 03aaf93c5

THRIFT-2010 Generate c_glib code doesn't compile with strict gcc flags
Patch: Miguel Angel Cabrera Moya


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/03aaf93c
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/03aaf93c
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/03aaf93c

Branch: refs/heads/master
Commit: 03aaf93c5381e8a5b63c2fd6d15c18b57cf13d20
Parents: 4285ba2
Author: Roger Meier <[email protected]>
Authored: Mon Jun 10 21:24:54 2013 +0200
Committer: Roger Meier <[email protected]>
Committed: Mon Jun 10 21:24:54 2013 +0200

----------------------------------------------------------------------
 compiler/cpp/src/generate/t_c_glib_generator.cc | 23 +++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/03aaf93c/compiler/cpp/src/generate/t_c_glib_generator.cc
----------------------------------------------------------------------
diff --git a/compiler/cpp/src/generate/t_c_glib_generator.cc 
b/compiler/cpp/src/generate/t_c_glib_generator.cc
index 1ad882f..373e6a8 100644
--- a/compiler/cpp/src/generate/t_c_glib_generator.cc
+++ b/compiler/cpp/src/generate/t_c_glib_generator.cc
@@ -1200,6 +1200,10 @@ void 
t_c_glib_generator::generate_service_client(t_service *tservice) {
     }
   }
 
+  /* write out the get/set function prototypes */
+  f_header_ << "void " + service_name_lc + "_client_set_property (GObject 
*object, guint property_id, const GValue *value, GParamSpec *pspec);" << endl;
+  f_header_ << "void " + service_name_lc + "_client_get_property (GObject 
*object, guint property_id, GValue *value, GParamSpec *pspec);" << endl;
+
   f_header_ << endl;
   // end of header code
 
@@ -1262,7 +1266,14 @@ void 
t_c_glib_generator::generate_service_client(t_service *tservice) {
     "      sizeof (" << this->nspace << service_name_ << "IfInterface)," <<
         endl <<
     "      NULL,  /* base_init */" << endl <<
-    "      NULL  /* base_finalize */" << endl <<
+    "      NULL,  /* base_finalize */" << endl <<
+    "      NULL,  /* class_init */" << endl <<
+    "      NULL,  /* class_finalize */" << endl <<
+    "      NULL,  /* class_data */" << endl <<
+    "      0,     /* instance_size */" << endl <<
+    "      0,     /* n_preallocs */" << endl <<
+    "      NULL,  /* instance_init */" << endl <<
+    "      NULL   /* value_table */" << endl <<
     "    };" << endl <<
     "    type = g_type_register_static (G_TYPE_INTERFACE," << endl <<
     "                                   \"" << this->nspace << service_name_ <<
@@ -1717,7 +1728,7 @@ void t_c_glib_generator::generate_object(t_struct 
*tstruct) {
 
   // generate the instance init function
   f_types_impl_ <<
-    "void " << endl <<
+    "static void " << endl <<
     this->nspace_lc << name_u << "_instance_init (" << this->nspace << name << 
" * object)" << endl <<
     "{" << endl;
 
@@ -1782,7 +1793,7 @@ void t_c_glib_generator::generate_object(t_struct 
*tstruct) {
 
   /* create the destructor */
   f_types_impl_ <<
-    "void " << endl <<
+    "static void " << endl <<
     this->nspace_lc << name_u << "_finalize (GObject *object)" << endl <<
     "{" << endl;
   indent_up();
@@ -1876,7 +1887,7 @@ void t_c_glib_generator::generate_object(t_struct 
*tstruct) {
 
 
   f_types_impl_ <<
-    "void " << endl <<
+    "static void " << endl <<
     this->nspace_lc << name_u << "_class_init (ThriftStructClass * cls)" << 
endl <<
     "{" << endl;
   indent_up();
@@ -1945,7 +1956,7 @@ void t_c_glib_generator::generate_struct_writer (ofstream 
&out,
   if (is_function) {
     error_ret = -1;
     indent(out) <<
-      "gint32" << endl <<
+      "static gint32" << endl <<
       this->nspace_lc << name_u <<
       "_write (ThriftStruct *object, ThriftProtocol *protocol, GError 
**error)" << endl;
   }
@@ -2032,7 +2043,7 @@ void t_c_glib_generator::generate_struct_reader(ofstream 
&out,
     error_ret = -1;
     indent(out) <<
       "/* reads a " << name_u << " object */" << endl <<
-      "gint32" << endl <<
+      "static gint32" << endl <<
       this->nspace_lc << name_u <<
           "_read (ThriftStruct *object, ThriftProtocol *protocol, GError 
**error)" << endl;
   }

Reply via email to