[Vala] Help with manual binding vapi for old C lib that uses only ASCII.
In libgvc.vapi : [CCode (cname = "gvLayout")] public int layout (Graph graph, [CCode (type = "char*")] string layout_engine); Does [CCode (type = "char*")] limit string to ascii only? If not should I just use char*? ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] Vala syntax file for Midnight Commander editor
https://raw.githubusercontent.com/agrellum/NetRexx-Samples/master/vala.syntax See this post to add it. https://superuser.com/questions/386904/is-it-possible-and-how-make-user-customization-for-syntax-highlighting-in-buil ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Why is 77 greater than 4294967295?
You can look at the old code base here. https://sourceforge.net/p/netrexx/code/ci/netrexx4android/tree/GObjexx.tar.gz?format=raw Just want to get it out there and working. Can not think and reason like I used too. ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Why is 77 greater than 4294967295?
Thanks, for the replys. Finishing a Vala project, I started 3 years ago. The Rexx data type and functions for the GObject system. Just writing unit tests and working out bugs. I am working with unichar in Vala. From Wikipedia, "Unicode 11.0, contains a repertoire of 137,439 characters" - "For Now" My data is a number in string form. example "77", "+77" I convert that back to number using a to_long function. From Wikipedia C data types, "unsigned int Contains at least the [0, 65,535]" will not get all my Unicode To avoid, "The unsigned int is converted to long and the maximum unsigned long is a negative signed long." var i = this.to_long (); //if ((i < uint.MIN) | (i > uint.MAX)) { // OK TO HARD CODE? - I JUST NEED POSITIVE NUMBER INSIDE the "137,439 characters" // to catch errors and works on 32 and 64 BIT. // Do not see my code running on 8 or 16 BIT and Unicode with 4294967295 chars. if ((i < 0) | (i > 2147483647)) { ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] Why is 77 greater than 4294967295?
// simple vala code void main () { long i = 77; stdout.printf ("%ld\n", i); // outputs 77 stdout.printf ("%u\n", uint.MIN); // outputs 0 if (i < uint.MIN) { stdout.printf ("Never made it here.\n"); } stdout.printf ("%u\n", uint.MAX); // outputs 4294967295 // G_MAXUINT if (i > uint.MAX) { stdout.printf ("Why am I here.\n"); } } valac --cc=gcc gbug.vala C code generated /* gbug.c generated by valac 0.40.11, the Vala compiler * generated from gbug.vala, do not modify */ #include #include #include void _vala_main (void); void _vala_main (void) { glong i = 0L; FILE* _tmp0_; glong _tmp1_; FILE* _tmp2_; glong _tmp3_; FILE* _tmp5_; glong _tmp6_; i = (glong) 77; _tmp0_ = stdout; _tmp1_ = i; fprintf (_tmp0_, "%ld\n", _tmp1_); _tmp2_ = stdout; fprintf (_tmp2_, "%u\n", 0); _tmp3_ = i; if (_tmp3_ < ((glong) 0)) { FILE* _tmp4_; _tmp4_ = stdout; fprintf (_tmp4_, "Never made it here.\n"); } _tmp5_ = stdout; fprintf (_tmp5_, "%u\n", G_MAXUINT); _tmp6_ = i; if (_tmp6_ > ((glong) G_MAXUINT)) { FILE* _tmp7_; _tmp7_ = stdout; fprintf (_tmp7_, "Why am I here.\n"); } } int main (int argc, char ** argv) { _vala_main (); return 0; } ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] valadoc - How do I avoid this.
error: unexpected token: * The '//' operator. using this code documentation /** * The '//' operator. */ ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] Vala 0.36.7 now in OpenIndiana Hipster
#pkg install pkg://openindiana.org/developer/vala Thanks for answering my questions. ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] testrunner.sh on OpenIndiana
Cleaned and formatted testrunner.sh for OpenIndiana more ... added -v flag back FAIL: /methods/bug653391.vala fails from using -X -Werror=uninitialized [-Werror=maybe-uninitialized] Could be caused by c code vala generated on this platform or compiler version See many comments about how gcc (mis)handles these in the past on the web FAIL: /control-flow/bug736774-2.vala test ** ERROR:/export/home/agrellum/oi-userland/components/developer/vala/build/i86/tests/_test/main.c:111:control_flow_bug736774_2_main: assertion failed: (keep != "test") control_flow.bug736774_2.check: line 2: 4058 Abort (core dumped) ./test /control-flow/bug736774-2 Maybe real OpenIndiana or Vala bug? I am not good with core dumps and gdb Really liked debugging vala with nemiver but it needs deps and work to run on SunOS. I tried. FAIL: /dbus/filedescriptor-errors.test GLib: Cannot convert message: Conversion from character set 'UTF-8' to '646' is not supported Conversion from character set '646' to 'UTF-8' is not supported Terminated Could be how iconv, glib or dbus is built or setup here. On Wed, Nov 8, 2017 at 9:54 AM, Jason Martin wrote: > This is my latest patch with some things removed. CC fixed in oi-userland > Makefile and removed more cflags to build 32 and 64 > https://github.com/agrellum/oi-userland/blob/vala/ > components/developer/vala/patches/tests.patch > Four tests failed but I now have test snapshots setup. > https://github.com/agrellum/oi-userland/blob/vala/ > components/developer/vala/test/results-all.master > ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] testrunner.sh on OpenIndiana
This is my latest patch with some things removed. CC fixed in oi-userland Makefile and removed more cflags to build 32 and 64 https://github.com/agrellum/oi-userland/blob/vala/components/developer/vala/patches/tests.patch Four tests failed but I now have test snapshots setup. https://github.com/agrellum/oi-userland/blob/vala/components/developer/vala/test/results-all.master ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] testrunner.sh on OpenIndiana
All but three pass now. My patch below. Comments might help someone. /control-flow/bug736774-2 ERROR:/export/home/agrellum/vala-0.36.6/tests/_test/main.c:111:control_flow_bug736774_2_main: assertion failed: (keep != "test") control_flow.bug736774_2.check: line 2: 17168 Abort (core dumped) ./test /control-flow/bug736774-2 /dbus/enum-string-marshalling main.vala:17.42-17.57: error: The type name `UnixOutputStream' could not be found public abstract void test3 (FooEnum e1, UnixOutputStream output_stream, FooEnum e2) throws DBusError; Loaded package `/export/home/agrellum/vala-0.36.6/tests/./../vapi/glib-2.0.vapi' Loaded package `/export/home/agrellum/vala-0.36.6/tests/./../vapi/gobject-2.0.vapi' Loaded package `/export/home/agrellum/vala-0.36.6/tests/./../vapi/gio-2.0.vapi' /dbus/filedescriptor-errors/server Conversion from character set '646' to 'UTF-8' is not supported Patch: --- /export/home/agrellum/vala-0.36.6/tests/testrunner.sh.orig +++ /export/home/agrellum/vala-0.36.6/tests/testrunner.sh @@ -29,7 +29,12 @@ export G_DEBUG=fatal_warnings VALAC=$topbuilddir/compiler/valac$EXEEXT -VALAFLAGS="$VALAFLAGS --vapidir $vapidir --disable-warnings --main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X -DGETTEXT_PACKAGE=\"valac\" -X -Werror=return-type -X -Werror=init-self -X -Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X -Werror=pointer-arith -X -Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -Wformat -X -Werror=format-security -X -Werror=format-nonliteral -X -Werror=redundant-decls -X -Werror=int-conversion" +#VALAFLAGS="$VALAFLAGS --vapidir $vapidir --disable-warnings --main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X -DGETTEXT_PACKAGE=\"valac\" -X -Werror=return-type -X -Werror=init-self -X -Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X -Werror=pointer-arith -X -Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -Wformat -X -Werror=format-security -X -Werror=format-nonliteral -X -Werror=redundant-decls -X -Werror=int-conversion" +# OpenIndiana add -v flag for extra logging +# Hardcoded --cc flag for now; Use ./configure CC=gcc when building vala +# System can have many CC's and gcc may not be default +# Remove -X -Werror=int-conversion; Not an option with gcc (GCC) 4.9.4 OpenIndiana build +VALAFLAGS="$VALAFLAGS -v --cc=gcc --vapidir $vapidir --disable-warnings --main main --save-temps -X -g -X -O0 -X -pipe -X -lm -X -DGETTEXT_PACKAGE=\"valac\" -X -Werror=return-type -X -Werror=init-self -X -Werror=implicit -X -Werror=sequence-point -X -Werror=return-type -X -Werror=uninitialized -X -Werror=pointer-arith -X -Werror=int-to-pointer-cast -X -Werror=pointer-to-int-cast -X -Wformat -X -Werror=format-security -X -Werror=format-nonliteral -X -Werror=redundant-decls" VAPIGEN=$topbuilddir/vapigen/vapigen$EXEEXT VAPIGENFLAGS="--vapidir $vapidir" @@ -114,26 +119,32 @@ } testdir=_test -rm -rf $testdir -mkdir $testdir -cd $testdir - -echo -n -e "TEST: Building...\033[72G" - -cat << "EOF" > checkall + +# Added +echo "Use gmake check &> test.log for hard coded log file" +# Changed echo -n -e to printf; No echo -options SunOS; just use newline +printf "TEST: Building...\n" + +for testfile in "$@"; do +PACKAGES=gio-2.0 +SOURCEFILES= +cd $builddir +rm -rf $testdir +mkdir $testdir +cd $testdir + +cat << "EOF" > checkall all=0 fail=0 EOF -cat << "EOF" > main.vala +cat << "EOF" > main.vala void main (string[] args) { switch (args[1]) { EOF -PACKAGES=gio-2.0 -SOURCEFILES= -for testfile in "$@"; do -rm -f prepare check +# Changed; entire $testdir is removed inside loop now +#rm -f prepare check echo 'set -e' >> prepare case "$testfile" in @@ -172,7 +183,8 @@ INHEADER=0 fi else -if echo "$line" | grep -q "^[A-Za-z]\+:"; then +# Changed "^[A-Za-z]\+:" to "^[A-Za-z]*:" +if echo "$line" | grep -q "^[A-Za-z]*:"; then sourceend PART=$(($PART + 1)) INHEADER=1 @@ -189,24 +201,28 @@ esac cat prepare check > $ns.check +# Changed echo -n -e and echo -e to printf +# Changed [72G to [50G TEST RESULT SUMMARY all one line and < 80 chars. cat << EOF >> checkall -echo -n -e " /$testpath: \033[72G" +printf " /$testpath: \033[50G" ((all++)) if bash $ns.check &>log; then -echo -e "\033[0;32mOK\033[m" +printf "\033[0;32mOK\033[m" else ((fail++)) -echo -e "\033[0;31mFAIL\033[m" +printf "\033[0;31mFAIL\033[m" cat log fi EOF -done - +# Moved to end +#done + +# Adds space between RESULT and Summary cat << "EOF" >> checkall if [ $fail -eq 0 ]; then -echo "All $all tests passed" +echo " All $all tests passed" else
[Vala] testrunner.sh on OpenIndiana
Should test enum-string-marshalling.vala include a Packages: statement? gio-unix-2.0 posix I got my tests somewhat working but I had to create a run one at a time script. #!/usr/bin/env bash for testfile in "$@"; do echo $testfile ./testone.sh $testfile done 244 Pass OK. The ones named *.test not working yet. Am I right, the Makefile generated on other systems calls testrunner.sh in that way? ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] New test framework updates.
Just a update: I settled with just "printf" and not "env printf" in the patch for testrunner.sh System has multiple compilers and I found that out using by adding valac -v flag in VALAFLAGS in testrunner.sh Had to add VALAFLAGS="$VALAFLAGS --cc=gcc ; this might be a flag needed in new build system. Then found out gcc (GCC) 4.9.4 has no option -Wint-conversion on OpenIndiana cc1: error: -Werror=int-conversion: no option -Wint-conversion First test now runs but fails on the next ones. ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] New test framework updates.
I have replaced echo -n -e or echo -e and I think that works. (patch below) And I get a _test dir under tests but I do not think the check files are right. Example: annotations.deprecated.check set -e ./test /annotations/deprecated And my main.vala has all tests combined in one big program. Seems to not be splitting them into each test. Also has problems with the combined ones with "Program: something" If someone could tar.gz the tests directory from a linux build that might help me to see what is supposed to happen. My patch so far: --- testrunner.shSun Oct 8 10:39:01 2017 +++ testrunner.sh.newTue Oct 17 11:10:41 2017 @@ -118,7 +118,7 @@ mkdir $testdir cd $testdir -echo -n -e "TEST: Building...\033[72G" +env printf "TEST: Building...\033[72G" cat << "EOF" > checkall all=0 @@ -190,13 +190,13 @@ cat prepare check > $ns.check cat << EOF >> checkall -echo -n -e " /$testpath: \033[72G" +env printf " /$testpath: \033[72G" ((all++)) if bash $ns.check &>log; then -echo -e "\033[0;32mOK\033[m" +env printf "\033[0;32mOK\033[m" else ((fail++)) -echo -e "\033[0;31mFAIL\033[m" +env printf "\033[0;31mFAIL\033[m" cat log fi EOF @@ -219,10 +219,10 @@ cat $SOURCEFILES >> main.vala -if $VALAC $VALAFLAGS -o test$EXEEXT $([ -z "$PACKAGES" ] || echo $PACKAGES | xargs -n 1 echo -n " --pkg") main.vala &>log; then -echo -e "\033[0;32mOK\033[m" +if $VALAC $VALAFLAGS -o test$EXEEXT $([ -z "$PACKAGES" ] || echo $PACKAGES | xargs -n 1 env printf "%s" " --pkg=") main.vala &>log; then +env printf "\033[0;32mOK\033[m" else -echo -e "\033[0;31mFAIL\033[m" +env printf "\033[0;31mFAIL\033[m" cat log cd $builddir ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] New test framework updates.
It looks like the first echo -n problem is on line 222 in testrunner.sh if $VALAC $VALAFLAGS -o test$EXEEXT $([ -z "$PACKAGES" ] || echo $PACKAGES | xargs -n 1 echo -n " --pkg") main.vala &>log; then TEST: Building... FAIL Unknown option -n Run '/export/home/agrellum/vala-0.36.6/compiler/.libs/valac --help' to see a full list of available command line options. ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] New test framework updates.
Trying to update to vala-0.36.6 from vala-0.36.4 but on solaris or sunos: echo takes no options. >From checkall: echo -n -e " /basic-types/integers: \033[72G" ((all++)) if bash basic_types.integers.check &>log; then echo -e "\033[0;32mOK\033[m" else ((fail++)) echo -e "\033[0;31mFAIL\033[m" cat log fi ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Vala on OpenIndiana Updated
GLib.Math.pow10.vala GLib.Math.pow10f.vala These functions are missing on some platforms: Some of the core dumps are truly meant to be core dumps. Maybe a good vala example (someone more qualified than me) of trapping signals would be handy? ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] Vala on OpenIndiana Updated
With help; got developer/vala (openindiana.org) 0.36.4-2017.0.0.2 into https://github.com/OpenIndiana/oi-userland 940 examples from https://github.com/valadoc/valadoc-org 62 examples from https://github.com/acmeism/RosettaCodeData 974 PASSED Skipped --pkg gee-1.0 and some more examples Still have not figured these two out: GLib.Math.pow10.vala GLib.Math.pow10f.vala Only 5 cores left - seems to be related to process abort assertions.vala GLib.error.vala GLib.Process.abort.vala GLib.Test.fail.vala GLib.Test.run.vala GLib.Test.trap_assert_passed.vala Fixed GLib.Array.prepend_vals.vala added string b = "3. entry"; changed array.prepend_val (b); The samples at https://valadoc.org/gmodule-2.0/GLib.Module.html worked after -X --shared was changed to -X -shared valac working great!!! ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Vala on OpenIndiana or Solaris
Redone with OpenIndiana Hipster's primary build framework oi-userland https://github.com/OpenIndiana/oi-userland Still get cores with all my build variations Example GLib.Array.prepend_vals.vala gdb states: 0xfec96f9b in strlen () from /lib/libc.so.1 Then I installed the Vala 0.29.3 from: http://sfe.opencsw.org/localhostoih/en/index.shtml Same result. Then install Vala 0.20.1 from hipster repo Same result. To tired and sick to go any futher for now. Sorry. ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] Vala on OpenIndiana or Solaris
Just trying out latest OpenIndiana's Hipster with all updates. Want Vala to run well on it. New to the Solaris way of doing things. Used http://sfe.opencsw.org/localhostoih/info/0/pkg%3A%2F%2Flocalhostoih%2Fsfe%2Fdeveloper%2Fvala%400.29.3%2C5.11-0.0.151.1.8%3A20160710T175029Z to bootstrap build vala-0.36.4.tar.xz Had to manually cp vapigen.pc to vapigen-0.36.pc and libvala.pc to libvala-0.36.pc and run extra make in a few directories >From old examples https://valadoc.org I archived May 2015 910 of 940 build and run well 13 in that batch Segmentation Fault (core dumped) GLib.Array.prepend_vals.vala GLib.error.vala GLib.Error.vala GLib.FileStream.getc.vala GLib.FileStream.gets.vala GLib.FileStream.read_line.vala GLib.Process.abort.vala GLib.Test.fail.vala GLib.Test.rand_bit.vala GLib.Test.rand_int_range.vala GLib.Test.rand_int.vala GLib.Test.run.vala GLib.Test.trap_assert_passed.vala 2 would not build at all https://valadoc.org/glib-2.0/GLib.Math.pow10.html https://valadoc.org/glib-2.0/GLib.Math.pow10f.html Both say: warning: implicit function declaration Undefined symbol first referenced in file Skipped building a few Got a lot of warning: improper pointer/integer combination: op "=" https://docs.oracle.com/cd/E19205-01/819-5265/bjane/index.html How do you add header file to the vala source file to fix this? Thanks ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Having a problem understanding Vala or Gee HashMap
Got it. Thanks again. On Thu, Aug 6, 2015 at 4:52 AM, Jason Martin wrote: > I am porting some Java software to Vala but I cannot understand why the > following code will not work like I think it should. > > Vala 0.26.2, libgee-0.8 on Xubuntu 15.04 > > Thanks in advance. I have used many variations and casts but I cannot get > @get or has_key for Gee.HashMap to work. (website samples work fine for me) > > I placed notes in the comments. > > > public virtual RexxNode getnode (Rexx key) { > > /* this.coll is part of a whole Rexx Object */ > if (this.coll == null) { > lock (this.coll) { > if (this.coll == null) { // still virgin > this.coll = new HashMap (); // make a hashtable > /* IF I place a @set entry here for testing only */ > /* var node = this.coll.@get (key) below finds it */ > } > } > } > > /* But it ALWAYS RETURNS NULL - for any other entry */ > var node = this.coll.@get (key); // look it up > > /* foreach works like it should */ > foreach (var entry in coll.entries) { > if (key.OpEqS(null, entry.key)) { > stdout.printf ("we found the key - it's there\n"); > /* BUT this also RETURNS has key FALSE */ > stdout.printf("has key %s\n", this.coll.has_key(key).to_string ()); > node = entry.value; > } > } > > if (node != null) { // found > if (node.leaf != null) { > stdout.printf ("Only gets here if foreach is used\n"); > ; > } > } else { > node = new RexxNode (new Rexx.clone (this)); // make node > /* @set works fine unlike @get or has_key */ > this.coll.@set (key, node); // save > } > > return node; > } > > ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] Having a problem understanding Vala or Gee HashMap
I am porting some Java software to Vala but I cannot understand why the following code will not work like I think it should. Vala 0.26.2, libgee-0.8 on Xubuntu 15.04 Thanks in advance. I have used many variations and casts but I cannot get @get or has_key for Gee.HashMap to work. (website samples work fine for me) I placed notes in the comments. public virtual RexxNode getnode (Rexx key) { /* this.coll is part of a whole Rexx Object */ if (this.coll == null) { lock (this.coll) { if (this.coll == null) { // still virgin this.coll = new HashMap (); // make a hashtable /* IF I place a @set entry here for testing only */ /* var node = this.coll.@get (key) below finds it */ } } } /* But it ALWAYS RETURNS NULL - for any other entry */ var node = this.coll.@get (key); // look it up /* foreach works like it should */ foreach (var entry in coll.entries) { if (key.OpEqS(null, entry.key)) { stdout.printf ("we found the key - it's there\n"); /* BUT this also RETURNS has key FALSE */ stdout.printf("has key %s\n", this.coll.has_key(key).to_string ()); node = entry.value; } } if (node != null) { // found if (node.leaf != null) { stdout.printf ("Only gets here if foreach is used\n"); ; } } else { node = new RexxNode (new Rexx.clone (this)); // make node /* @set works fine unlike @get or has_key */ this.coll.@set (key, node); // save } return node; } ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list