[Gtk-sharp-list] Possible Error in gapi2-parser util.

enzo - Eduardo Garcia enzo at enzolutions.com
Wed Sep 28 00:33:49 EDT 2005


Hi people.

Today  I'm begin to make a binding to planner-dev project, this project 
you can see  here [1], to make this binding i use
this documentation [2] from mono project site.

Everything is ok!, Except a one transformartion from planner-dev, the 
error is a enum transformation, this its a enum in the file 
mrp-storage-module.h

typedef enum {
        MRP_STORAGE_NONE                = 0,
        MRP_STORAGE_READABLE            = 1 << 0,
        MRP_STORAGE_WRITABLE            = 1 << 1,
        MRP_STORAGE_DIRECT_WRITE        = 1 << 2,
        MRP_STORAGE_SUPPORTS_TASK       = 1 << 3,
        MRP_STORAGE_SUPPORTS_RESOURCE   = 1 << 4,
        MRP_STORAGE_SUPPORTS_PRIMARY    = 1 << 5,

        MRP_STORAGE_READWRITE           = (MRP_STORAGE_READABLE |
                                            MRP_STORAGE_WRITABLE),

        MRP_STORAGE_SUPPORTS_ALL        = (MRP_STORAGE_SUPPORTS_TASK |
                                           MRP_STORAGE_SUPPORTS_RESOURCE |
                                           MRP_STORAGE_SUPPORTS_PRIMARY)
} MrpStorageModuleFlags;


when im run #gapi2-parser sources/planner.sources.xml

this command tranforms the enum in this code:

namespace PLanner {

        using System;
        using System.Runtime.InteropServices;

#region Autogenerated code
        [Flags]
        public enum MrpStorageModuleFlags {

                None,
                Readable = 1 << 0,
                Writable = 1 << 1,
                DirectWrite = 1 << 2,
                SupportsTask = 1 << 3,
                SupportsResource = 1 << 4,
                SupportsPrimary = 1 << 5,
                Readwrite = MRP_STORAGE_READABLE |MRP_STORAGE_WRITABLE,
                SupportsAll = MRP_STORAGE_SUPPORTS_TASK 
|MRP_STORAGE_SUPPORTS_RESOURCE |MRP_STORAGE_SUPPORTS_PRIMARY,
        }
#endregion
}


the problem is the last definitions use previus definitions in the enum. 
so when gapi2-parser transforms the enum cannot detect this and make a 
wrong transformatios.

The questions is, is real error or bug or i is this a bad programming way?

please check this question and say me if you thinks i need post a bug 
from gtk-sharp bugzilla.


thanks.

enzo
Eduardo Garcia.

[1] http://developer.imendio.com/wiki/Planner
[2] http://www.mono-project.com/GAPI



More information about the Gtk-sharp-list mailing list