Re: [Vala] [Genie] Problem with enums in genie
Should now be fixed in master jamie On Mon, 2010-09-27 at 14:55 +0200, Nicolas wrote: > Hello, > > There is a long time that I did not use "enums" in my code and now I see > that it no longer works as before, what's the problem? > > [indent=4] > > enum EnumTest > value1 = "Hello !" > > init > print EnumTest.value1 > > > test-enum.gs:7.11-7.25: error: Access to private member > `EnumTest.value1' denied > > Thanks in advance, > Nicolas. > ___ > vala-list mailing list > vala-list@gnome.org > http://mail.gnome.org/mailman/listinfo/vala-list ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] valgrind or something similar
thanks for all the tips. > Hey August, > > Am Sonntag, den 26.09.2010, 20:18 +0200 schrieb august: > > Is there something like a valgrind or method for debugging memory > > leaks and mismanagement? > > Something that helped me in real life (tm) was using nemiver and > watching the ref_count field of Object derived classes. > > You need to compile the vala files using the -g flag, to be able to use > nemiver (a gdb gui). > > Greetings > - fabian ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
[Vala] appsink binding in gstreamer
I was talking with some folks about the faulty appsink bindings in gstreamer on IRC last night. I also found this online: http://www.mail-archive.com/vala-list@gnome.org/msg05147.html Any answers to those questions? It seems you can't even create the AppSink object. Is there another way to create it and set the signals using ElementFactory ? thanks -august. ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] [Genie] Problem with enums in genie
I need to update the genie parser to fix this error - will have it done end of today It should work fine with an earlier version of vala as it only appears in the latest release On Mon, 2010-09-27 at 14:55 +0200, Nicolas wrote: > Hello, > > There is a long time that I did not use "enums" in my code and now I see > that it no longer works as before, what's the problem? > > [indent=4] > > enum EnumTest > value1 = "Hello !" > > init > print EnumTest.value1 > > > test-enum.gs:7.11-7.25: error: Access to private member > `EnumTest.value1' denied > > Thanks in advance, > Nicolas. > ___ > vala-list mailing list > vala-list@gnome.org > http://mail.gnome.org/mailman/listinfo/vala-list ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] [Genie] Problem with enums in genie
Hello, There is a long time that I did not use "enums" in my code and now I see that it no longer works as before, what's the problem? [indent=4] enum EnumTest value1 = "Hello !" init print EnumTest.value1 test-enum.gs:7.11-7.25: error: Access to private member `EnumTest.value1' denied Thanks in advance, Nicolas. ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Debugging program xml-rpc-c bindings?
Would be great if somebody could commit my xmlrpc-c.vapi into the vala/vapi repository Looks like you are trying to parse as an array something that it is not an array and xmlrpc library is raising an abort signal. On 09/27/10 11:59, Phil Daintree wrote: Although I can retrieve the xml-rpc data using pancake's xmlrpc_c bindings the program aborts at the end as it trys to free the memory used I guess? Clutching at straws - wonder if anyone can make sense of this output from gdb - perhaps a bug in xml-rpc-c or the bindings? Same result in vala and genie. (gdb) run Starting program: /initrd/mnt/dev_save/my-applications/POSLogic/POSLogic [New Thread 0xb78deb70 (LWP 9942)] [Thread 0xb78deb70 (LWP 9942) exited] An Array of [5] elements component [0] of array = a string: (AUD) component [1] of array = a string: (CHF) component [2] of array = a string: (EUR) component [3] of array = a string: (GBP) component [4] of array = a string: (USD) Program received signal SIGABRT, Aborted. 0xb7cc6607 in raise () from /lib/libc.so.6 (gdb) backtrace #0 0xb7cc6607 in raise () from /lib/libc.so.6 #1 0xb7cc9ab2 in abort () from /lib/libc.so.6 #2 0xb7c91a2a in xmlrpc_abort_if_array_bad (arrayP=0x80c3110) at xmlrpc_array.c:43 #3 0xb7c91a70 in xmlrpc_destroyArrayContents (arrayP=0x80c3110) at xmlrpc_array.c:64 #4 0xb7c8efa8 in destroyValue (valueP=0x80c3110) at xmlrpc_data.c:44 #5 xmlrpc_DECREF (valueP=0x80c3110) at xmlrpc_data.c:106 #6 0x08049d92 in update_currencies () #7 0x08049927 in _vala_main () #8 0x080499c6 in main () (gdb) Extract of the genie program: def update_currencies(ref SQL:SQLiteO, ref Config: dict of string, string) :void /*XmlRpc objects required for the xml-rpc session defined */ XClient: XmlRpc.Client /*This is the client object created by the Client Create */ XEnv: XmlRpc.Env = XmlRpc.Env() /* This is the XmlRpc Env struct */ XServer: XmlRpc.ServerInfo* = new XmlRpc.ServerInfo (XEnv, Config["webERPXmlRpcServer"]) /*initialise the xml-rpc client session */ /*variables for the setup of the xml-rpc session */ ProgramName:string = "POSLogic XML-RPC Update Currencies" ProgramVersion:string = "0.1" XmlRpc.Client.init (0, ProgramName, ProgramVersion) XmlRpc.Client.create (XEnv, 0, ProgramName, ProgramVersion, null, 0, out XClient) if XEnv.fault_occurred print "Setting the properties of the xml-rpc server failed with the message: %s fault code: %d", XEnv.fault_string, XEnv.fault_code Thread.exit (null) var XQuery = new XmlRpc.Array(XEnv) /*XML-RPC call the method weberp.xmlrpc_GetCurrencyList this method requires 2 strings as parameters - all put into the new XQuery array in sequence 0, 1 username password This method returns a structure containing an array of currency codes: key "currcode" (currency codes) */ XQuery.append_item (XEnv, XEnv.string_new (Config["webERPUser"])) XQuery.append_item (XEnv, XEnv.string_new (Config["webERPPassword"])) XReturnValue: XmlRpc.Value ArraySize: int XmlRpcReturnError: int i:int = 0 /* Now do the actual xml-rpc call */ XClient.call2 (XEnv, XServer, " weberp.xmlrpc_GetCurrencyList", XQuery, out XReturnValue) if XEnv.fault_occurred print "Oops.. fault happened (%s)\n", XEnv.fault_string else print_value(XEnv,XReturnValue) def private print_value(XEnv:XmlRpc.Env, XValue:XmlRpc.Value) /*a recursive function that prints out the contents of the returned XML-RPC call */ /*Define all the variables used in the function */ i:int =0 XItem:XmlRpc.Value XArray:XmlRpc.Array ArraySize:int XStruct:XmlRpc.Struct ReturnedString: string ReturnedNumber:int XStructValue: XmlRpc.Value DataType:XmlRpc.Type = XValue.type () /*How we deal with the data depends on the type of data */ case (DataType) when XmlRpc.Type.ARRAY /* Cast the XValue into an XmlRpc.Array */ XArray = (XmlRpc.Array) XValue ArraySize = XArray.size(XEnv) print "An Array of [%d] elements\n", ArraySize /*for loop would be preferable here but it is not an iterable collection the next item in the array needs to be got with get_item method*/ while i < ArraySize XItem = XArray.get_item (XEnv, i) print " component [%d] of array = ", i /* function calls itself recursively */ print_value (XEnv, XItem) i++ when XmlRpc.Type.INT XEnv.read_int(XValue, out ReturnedNumber) print " an integer: (%d)\n", ReturnedNumber when XmlRpc.Type.STRING XEnv.read_string (XValue, out ReturnedString) print " a string: (%s)\n", ReturnedString when XmlRpc.Type.STR
[Vala] Debugging program xml-rpc-c bindings?
Although I can retrieve the xml-rpc data using pancake's xmlrpc_c bindings the program aborts at the end as it trys to free the memory used I guess? Clutching at straws - wonder if anyone can make sense of this output from gdb - perhaps a bug in xml-rpc-c or the bindings? Same result in vala and genie. (gdb) run Starting program: /initrd/mnt/dev_save/my-applications/POSLogic/POSLogic [New Thread 0xb78deb70 (LWP 9942)] [Thread 0xb78deb70 (LWP 9942) exited] An Array of [5] elements component [0] of array = a string: (AUD) component [1] of array = a string: (CHF) component [2] of array = a string: (EUR) component [3] of array = a string: (GBP) component [4] of array = a string: (USD) Program received signal SIGABRT, Aborted. 0xb7cc6607 in raise () from /lib/libc.so.6 (gdb) backtrace #0 0xb7cc6607 in raise () from /lib/libc.so.6 #1 0xb7cc9ab2 in abort () from /lib/libc.so.6 #2 0xb7c91a2a in xmlrpc_abort_if_array_bad (arrayP=0x80c3110) at xmlrpc_array.c:43 #3 0xb7c91a70 in xmlrpc_destroyArrayContents (arrayP=0x80c3110) at xmlrpc_array.c:64 #4 0xb7c8efa8 in destroyValue (valueP=0x80c3110) at xmlrpc_data.c:44 #5 xmlrpc_DECREF (valueP=0x80c3110) at xmlrpc_data.c:106 #6 0x08049d92 in update_currencies () #7 0x08049927 in _vala_main () #8 0x080499c6 in main () (gdb) Extract of the genie program: def update_currencies(ref SQL:SQLiteO, ref Config: dict of string, string) :void /*XmlRpc objects required for the xml-rpc session defined */ XClient: XmlRpc.Client /*This is the client object created by the Client Create */ XEnv: XmlRpc.Env = XmlRpc.Env() /* This is the XmlRpc Env struct */ XServer: XmlRpc.ServerInfo* = new XmlRpc.ServerInfo (XEnv, Config["webERPXmlRpcServer"]) /*initialise the xml-rpc client session */ /*variables for the setup of the xml-rpc session */ ProgramName:string = "POSLogic XML-RPC Update Currencies" ProgramVersion:string = "0.1" XmlRpc.Client.init (0, ProgramName, ProgramVersion) XmlRpc.Client.create (XEnv, 0, ProgramName, ProgramVersion, null, 0, out XClient) if XEnv.fault_occurred print "Setting the properties of the xml-rpc server failed with the message: %s fault code: %d", XEnv.fault_string, XEnv.fault_code Thread.exit (null) var XQuery = new XmlRpc.Array(XEnv) /*XML-RPC call the method weberp.xmlrpc_GetCurrencyList this method requires 2 strings as parameters - all put into the new XQuery array in sequence 0, 1 username password This method returns a structure containing an array of currency codes: key "currcode" (currency codes) */ XQuery.append_item (XEnv, XEnv.string_new (Config["webERPUser"])) XQuery.append_item (XEnv, XEnv.string_new (Config["webERPPassword"])) XReturnValue: XmlRpc.Value ArraySize: int XmlRpcReturnError: int i:int = 0 /* Now do the actual xml-rpc call */ XClient.call2 (XEnv, XServer, " weberp.xmlrpc_GetCurrencyList", XQuery, out XReturnValue) if XEnv.fault_occurred print "Oops.. fault happened (%s)\n", XEnv.fault_string else print_value(XEnv,XReturnValue) def private print_value(XEnv:XmlRpc.Env, XValue:XmlRpc.Value) /*a recursive function that prints out the contents of the returned XML-RPC call */ /*Define all the variables used in the function */ i:int =0 XItem:XmlRpc.Value XArray:XmlRpc.Array ArraySize:int XStruct:XmlRpc.Struct ReturnedString: string ReturnedNumber:int XStructValue: XmlRpc.Value DataType:XmlRpc.Type = XValue.type () /*How we deal with the data depends on the type of data */ case (DataType) when XmlRpc.Type.ARRAY /* Cast the XValue into an XmlRpc.Array */ XArray = (XmlRpc.Array) XValue ArraySize = XArray.size(XEnv) print "An Array of [%d] elements\n", ArraySize /*for loop would be preferable here but it is not an iterable collection the next item in the array needs to be got with get_item method*/ while i < ArraySize XItem = XArray.get_item (XEnv, i) print " component [%d] of array = ", i /* function calls itself recursively */ print_value (XEnv, XItem) i++ when XmlRpc.Type.INT XEnv.read_int(XValue, out ReturnedNumber)