From marcobra.ubuntu at ...176... Wed Dec 4 22:32:53 2013 From: marcobra.ubuntu at ...176... (marco bra) Date: Wed, 4 Dec 2013 22:32:53 +0100 Subject: [Gambas-devel] Compiling error on Ubuntu 13.04 32 bits Message-ID: With gambas3 rev. 5977 export QT_SELECT=qt4 ./reconf; ./configure -C --enable-image.imlib --enable-v4l --enable-sdl; make clean make ... .... make[4]: ingresso nella directory "/home/ubuntu/src/gambas/trunk/gb.db.sqlite2/src" CXX gb_db_sqlite2_la-main.lo In file included from dataset.h:61:0, from sqlitedataset.h:56, from main.cpp:39: qry_dat.h:299:3: error: 'sqlite' does not name a type sqlite *conn; //NG ^ In file included from main.cpp:39:0: sqlitedataset.h:93:3: error: 'sqlite' does not name a type sqlite *conn; ^ sqlitedataset.h:106:3: error: 'sqlite' does not name a type sqlite *getHandle() { return conn; } ^ sqlitedataset.h:151:3: error: 'sqlite' does not name a type sqlite* handle(); ^ main.cpp: In function 'int db_version()': main.cpp:497:9: error: 'sqlite_version' was not declared in this scope sscanf(sqlite_version,"%2u.%2u.%2u", &verMain, &verMajor, &verMinor); ^ main.cpp: In function 'int open_database(DB_DESC*, DB_DATABASE*)': main.cpp:583:40: error: 'sqlite_encoding' was not declared in this scope db->charset = GB.NewZeroString(strcmp(sqlite_encoding, "iso8859") == 0 ? "ISO-8859-1" : "UTF-8"); ^ make[4]: *** [gb_db_sqlite2_la-main.lo] Errore 1 make[4]: uscita dalla directory "/home/ubuntu/src/gambas/trunk/gb.db.sqlite2/src" make[3]: *** [all-recursive] Errore 1 make[3]: uscita dalla directory "/home/ubuntu/src/gambas/trunk/gb.db.sqlite2" make[2]: *** [all] Errore 2 make[2]: uscita dalla directory "/home/ubuntu/src/gambas/trunk/gb.db.sqlite2" make[1]: *** [all-recursive] Errore 1 make[1]: uscita dalla directory "/home/ubuntu/src/gambas/trunk" make: *** [all] Errore 2 ..... Thank you Marco -- Linux Infinite Freedom I'm writing from this place: http://www.openstreetmap.org/?lat=44.39945&lon=8.6798&zoom=15&layers=M From tobias at ...692... Mon Dec 9 19:42:10 2013 From: tobias at ...692... (Tobias Boege) Date: Mon, 9 Dec 2013 19:42:10 +0100 Subject: [Gambas-devel] GB.ReturnNewString() in gb.pcre Message-ID: <20131209184210.GB522@...693...> Hi Benoit, there is a call to GB.ReturnNewString() in gb.pcre which generates annoying advices not to use it but to use GB.ReturnNewZeroString() instead. Does this make sense? GB.ReturnNewString() seems to be the better way in that case... I also use it in gb.openssl to create a Gambas string from a binary char array. What's the matter with GB.ReturnNewString()? Regards, Tobi From gambas at ...1... Mon Dec 9 20:08:59 2013 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Mon, 09 Dec 2013 20:08:59 +0100 Subject: [Gambas-devel] GB.ReturnNewString() in gb.pcre In-Reply-To: <20131209184210.GB522@...693...> References: <20131209184210.GB522@...693...> Message-ID: <52A6154B.1010406@...1...> Le 09/12/2013 19:42, Tobias Boege a ?crit : > Hi Benoit, > > there is a call to GB.ReturnNewString() in gb.pcre which generates annoying > advices not to use it but to use GB.ReturnNewZeroString() instead. Does this > make sense? GB.ReturnNewString() seems to be the better way in that case... I should have fixed that in revision #5992 for gb.pcre. The warning message is printed when the "length" argument of GB.ReturnNewString() is lower or equal than zero, because it won't return a null string but compute the string length with strlen() (this is a backward-compatibility with older versions of the interpreter API). If you want to return a void string, use GB.ReturnVoidString() as I did in gb.pcre. If you are using the old syntax of GB.ReturnNewString(), use GB.ReturnNewZeroString() instead. -- Beno?t Minisini From tobias at ...692... Mon Dec 9 20:31:43 2013 From: tobias at ...692... (Tobias Boege) Date: Mon, 9 Dec 2013 20:31:43 +0100 Subject: [Gambas-devel] GB.ReturnNewString() in gb.pcre In-Reply-To: <52A6154B.1010406@...1...> References: <20131209184210.GB522@...693...> <52A6154B.1010406@...1...> Message-ID: <20131209193143.GC522@...693...> On Mon, 09 Dec 2013, Beno?t Minisini wrote: > Le 09/12/2013 19:42, Tobias Boege a ?crit : > > Hi Benoit, > > > > there is a call to GB.ReturnNewString() in gb.pcre which generates annoying > > advices not to use it but to use GB.ReturnNewZeroString() instead. Does this > > make sense? GB.ReturnNewString() seems to be the better way in that case... > > I should have fixed that in revision #5992 for gb.pcre. > > The warning message is printed when the "length" argument of > GB.ReturnNewString() is lower or equal than zero, because it won't > return a null string but compute the string length with strlen() (this > is a backward-compatibility with older versions of the interpreter API). > > If you want to return a void string, use GB.ReturnVoidString() as I did > in gb.pcre. > > If you are using the old syntax of GB.ReturnNewString(), use > GB.ReturnNewZeroString() instead. > OK, the message didn't say that this is about the length parameter. I thought GB.ReturnNewString() would be deprecated in a next version or so... I use it only with positive lengths. Regards, Tobi From tobias at ...692... Mon Dec 30 02:49:20 2013 From: tobias at ...692... (Tobias Boege) Date: Mon, 30 Dec 2013 02:49:20 +0100 Subject: [Gambas-devel] [Gambas-devel-svn] SF.net SVN: gambas:[6035] gambas/trunk In-Reply-To: References: Message-ID: <20131230014920.GH13849@...693...> On Mon, 30 Dec 2013, tobiasboe at ...1... wrote: > Revision: 6035 > http://sourceforge.net/p/gambas/code/6035 > Author: tobiasboe > Date: 2013-12-30 01:37:38 +0000 (Mon, 30 Dec 2013) > Log Message: > ----------- > [GB.INOTIFY] > * NEW: New component to interface Gambas with the Linux-specific inotifies > * NEW: The Inotify class can be created to watch a certain path for events > which are reported by various Gambas events being raised. > Benoit, the Inotify class gets a bonus reference because it is watched by the interpreter. IIRC, I have seen this in another component and begin now to wonder if this is necessary. Assumed, it wouldn't have that bonus reference and the user dropped the last "regular" reference (i.e. from a variable) and the _free() method would de-register the watch, wouldn't all be fine? Then the Inotify class would behave more naturally among other Gambas classes (which normally don't have hidden bonus references). Sample project attached. It works well because I use a console program and QUIT all the stuff away anyway. But my worries arose when I thought about using inotifies in a GUI application. I would have (to not use QUIT) to manually remove all the watches so that the interpreter terminates. This means I would have to save all the Inotify objects in an array and Release() every object, then clear the array. Doesn't sound like it should be... So: is this bonus reference for watched objects necessary or just an awry memory in my head? Regards, Tobi -- "There's an old saying: Don't change anything... ever!" -- Mr. Monk -------------- next part -------------- A non-text attachment was scrubbed... Name: test-inotify-0.0.1.tar.gz Type: application/octet-stream Size: 5727 bytes Desc: not available URL: From gambas at ...1... Mon Dec 30 03:16:01 2013 From: gambas at ...1... (=?ISO-8859-1?Q?Beno=EEt_Minisini?=) Date: Mon, 30 Dec 2013 03:16:01 +0100 Subject: [Gambas-devel] [Gambas-devel-svn] SF.net SVN: gambas:[6035] gambas/trunk In-Reply-To: <20131230014920.GH13849@...693...> References: <20131230014920.GH13849@...693...> Message-ID: <52C0D761.1040009@...1...> Le 30/12/2013 02:49, Tobias Boege a ?crit : > On Mon, 30 Dec 2013, tobiasboe at ...1... wrote: >> Revision: 6035 >> http://sourceforge.net/p/gambas/code/6035 >> Author: tobiasboe >> Date: 2013-12-30 01:37:38 +0000 (Mon, 30 Dec 2013) >> Log Message: >> ----------- >> [GB.INOTIFY] >> * NEW: New component to interface Gambas with the Linux-specific inotifies >> * NEW: The Inotify class can be created to watch a certain path for events >> which are reported by various Gambas events being raised. >> > > Benoit, the Inotify class gets a bonus reference because it is watched by > the interpreter. IIRC, I have seen this in another component and begin now > to wonder if this is necessary. > > Assumed, it wouldn't have that bonus reference and the user dropped the last > "regular" reference (i.e. from a variable) and the _free() method would > de-register the watch, wouldn't all be fine? Then the Inotify class would > behave more naturally among other Gambas classes (which normally don't have > hidden bonus references). > > Sample project attached. It works well because I use a console program and > QUIT all the stuff away anyway. > > But my worries arose when I thought about using inotifies in a GUI > application. I would have (to not use QUIT) to manually remove all the > watches so that the interpreter terminates. This means I would have to save > all the Inotify objects in an array and Release() every object, then clear > the array. Doesn't sound like it should be... > > So: is this bonus reference for watched objects necessary or just an awry > memory in my head? > > Regards, > Tobi > Hi, First, as inotify depends on no other library than the libc, you must put it in the /main/lib directory, not in its own component directory. The event loop won't terminate if there is at least one file descriptor to watch. It's up to you to disable the watch automatically as soon as the last notify object is freed. Apparently this is what you done, so I don't see the problem. But it is late, I will look at it another day. Regards, -- Beno?t Minisini