You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "wuhzj (JIRA)" <ji...@apache.org> on 2014/11/18 17:28:34 UTC

[jira] [Comment Edited] (THRIFT-2832) Generate thrift c_glib code for client only

    [ https://issues.apache.org/jira/browse/THRIFT-2832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14216374#comment-14216374 ] 

wuhzj edited comment on THRIFT-2832 at 11/18/14 4:28 PM:
---------------------------------------------------------

The warnings are similar, all are related to release of list<string> variable, I just paste one of them here. 

/home/jinzhao/nosql/hg_proxy_build/proxy/c/thrift_c_glib/o_n_d_b.c: In function 'o_n_d_b_processor_process_multi_delete':
/home/jinzhao/nosql/hg_proxy_build/proxy/c/thrift_c_glib/o_n_d_b.c:11309:7: warning: passing argument 1 of 'g_array_unref' from incompatible pointer type [enabled by default]
/usr/local/include/glib-2.0/glib/garray.h:84:9: note: expected 'struct GArray *' but argument is of type 'struct GPtrArray *'

The signature of the function multiDelete like below, there is a parameter list<string> includedTable, in the generated c code, includedTable is a variable with the type of GPtrArray * , but in the code to do cleanup work, it is released using g_array_unref(includedTable) but not g_ptr_array_unref(includedTable), so this cause the below warnings.

TInt multiDelete(1:string tableName, 2:TRow key, 3:TFieldRange fieldRange, 4:list<string> includedTable,   5:TWriteOptions writeOptions)
        throws (1:TDurabilityException de,
                2:TRequestTimeoutException re,
                3:TFaultException fe,
                4:TProxyException pe,
                5:TIllegalArgumentException iae);

In c code, the includedTable is released using g_array_unref() like bellow.

if (includedTable != NULL)
      g_array_unref (includedTable);

Not sure if above information is enough, please let me know If you need more information. Thanks in advance.


was (Author: wuhzj):
The warnings are similar,  I just paste one of them here. 


The signature of the function multiDelete like bellow, there is a parameter list<string> includedTable, in the generated c code, includedTable is a variable with GPtrArray * type, but in the code to do cleanup work, it is released using g_array_unref(includedTable) but not g_ptr_array_unref(includedTable), so this cause the below warnings.

TInt multiDelete(1:string tableName, 2:TRow key, 3:TFieldRange fieldRange, 4:list<string> includedTable,   5:TWriteOptions writeOptions)
        throws (1:TDurabilityException de,
                2:TRequestTimeoutException re,
                3:TFaultException fe,
                4:TProxyException pe,
                5:TIllegalArgumentException iae);





if (includedTable != NULL)
      g_array_unref (includedTable);



> Generate thrift c_glib code for client only
> -------------------------------------------
>
>                 Key: THRIFT-2832
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2832
>             Project: Thrift
>          Issue Type: Question
>          Components: C glib - Compiler
>    Affects Versions: 0.9.2
>            Reporter: wuhzj
>            Priority: Minor
>
> I noticed that in latest thrift v0.9.2, the C (GLib) compiler and library to add support for implementing servers.
> But in my case, I got some compiling warnings in when compiling the generated server side code after upgrade to 0.9.2. Actually, I just use thrift c glib in client side, Is it possible to generate the client side code only? 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)