[Vala] Some problems with migration to Vala 0.3.1



Hello,

I develop a project and I have some problems following the update of Vala.

First, with nullable types :

 - I can't use null with string, for example :
--------------------------------------------------------------------------------
public static void add_child (string! filename, string! xpath, string! name,
                                string content=null)
--------------------------------------------------------------------------------

Makes a warning :
--------------------------------------------------------------------------------
warning: `null' incompatible with parameter type `string`
--------------------------------------------------------------------------------

 - ! operator is deprected ? How force no-null parameter ?



Second, with length function :
--------------------------------------------------------------------------------
Xml.NodeSet* node = ...;

nodes->length ();
--------------------------------------------------------------------------------

is transformed to c code :
--------------------------------------------------------------------------------
xmlXPathNodeSetGetLength (((gpointer) nodes));
--------------------------------------------------------------------------------

but xmlXPathNodeSetGetLength is macro extend to :
--------------------------------------------------------------------------------
 ((ns) ? (ns)->nodeNr : 0)
--------------------------------------------------------------------------------

Makes an error :
--------------------------------------------------------------------------------
warning: dereferencing 'void *' pointer
error: request for member 'nodeNr' in something not a structure or union
--------------------------------------------------------------------------------

Merci d'avance pour votre aide.
-- 
Nicolas Joseph

Responsable de la rubrique GTK+ de developpez.com

http://nicolasj.developpez.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]