From a4707d329f938242fe234ed39d05ad59efb6af5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Fri, 21 Mar 2008 15:39:46 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * BUG: Importing a form now correctly associates the imported pictures. [INTERPRETER] * BUG: Fixed some structure alignment issues. git-svn-id: svn://localhost/gambas/trunk@1226 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas3/FCreateFile.class | 2 +- main/gbx/gbx_value.h | 21 ++++++++++++++++- main/share/gambas.h | 38 +++++++++++++++++++++---------- 3 files changed, 47 insertions(+), 14 deletions(-) diff --git a/app/src/gambas3/FCreateFile.class b/app/src/gambas3/FCreateFile.class index 2c59fe300..e09116757 100644 --- a/app/src/gambas3/FCreateFile.class +++ b/app/src/gambas3/FCreateFile.class @@ -313,7 +313,7 @@ PRIVATE SUB ImportDependencies(sName AS String, sOrig AS String, bLink AS Boolea IF NOT Exist(sDestImg) THEN Project.InsertFile(File.Name(sDestImg), File.Dir(sDestImg), sOrig &/ sImg, TRUE, bLink) ENDIF - sLine = Left(sLine, iPos + 7) & Chr$(34) & "import_" & sName &/ File.Name(sDestImg) & Chr$(34) & "]" + sLine = Left(sLine, iPos + 7) & Chr$(34) & "import" &/ sName &/ File.Name(sDestImg) & Chr$(34) & "]" bSave = TRUE ELSE CONTINUE diff --git a/main/gbx/gbx_value.h b/main/gbx/gbx_value.h index e498b0798..4d3744c7c 100644 --- a/main/gbx/gbx_value.h +++ b/main/gbx/gbx_value.h @@ -37,6 +37,7 @@ typedef TYPE type; int value; } + PACKED VALUE_BOOLEAN; typedef @@ -44,6 +45,7 @@ typedef TYPE type; int value; } + PACKED VALUE_BYTE; typedef @@ -51,6 +53,7 @@ typedef TYPE type; int value; } + PACKED VALUE_SHORT; typedef @@ -58,6 +61,7 @@ typedef TYPE type; int value; } + PACKED VALUE_INTEGER; typedef @@ -79,6 +83,10 @@ typedef typedef struct { TYPE type; + #if __WORDSIZE == 64 + #else + int _pad; + #endif double value; } PACKED @@ -87,6 +95,10 @@ typedef typedef struct { TYPE type; + #if __WORDSIZE == 64 + #else + int _pad; + #endif double value; } PACKED @@ -98,6 +110,7 @@ typedef int date; /* number of days */ int time; /* number of milliseconds */ } + PACKED VALUE_DATE; typedef @@ -107,6 +120,7 @@ typedef int start; int len; } + PACKED VALUE_STRING; typedef @@ -140,6 +154,7 @@ typedef TYPE ptype; intptr_t value[2]; } + PACKED VALUE_VOID; typedef @@ -161,6 +176,7 @@ typedef */ char value[8]; } + PACKED VALUE_VARIANT; typedef @@ -169,6 +185,7 @@ typedef void *object; void *super; } + PACKED VALUE_OBJECT; typedef @@ -177,6 +194,7 @@ typedef CLASS *class; void *super; } + PACKED VALUE_CLASS; typedef @@ -187,6 +205,7 @@ typedef short index; unsigned keep : 1; } + PACKED VALUE_ARRAY; typedef @@ -255,4 +274,4 @@ void VALUE_get_string(VALUE *val, char **text, int *length); #define VALUE_is_super(_value) (EXEC_super && EXEC_super == (_value)->_object.super) -#endif /* */ +#endif diff --git a/main/share/gambas.h b/main/share/gambas.h index 0ae2261c9..61646fc73 100644 --- a/main/share/gambas.h +++ b/main/share/gambas.h @@ -59,6 +59,10 @@ #define __null ((intptr_t)0) #endif +#ifndef PACKED +#define PACKED __attribute__((packed)) +#endif + /* Gambas datatypes identifiers */ #define GB_T_VOID 0 @@ -109,16 +113,16 @@ typedef union { GB_TYPE type; intptr_t _reserved[3]; - struct { GB_TYPE type; int value; } _boolean; - struct { GB_TYPE type; int value; } _byte; - struct { GB_TYPE type; int value; } _short; - struct { GB_TYPE type; int value; } _integer; - struct { GB_TYPE type; int64_t value; } _long; - struct { GB_TYPE type; double value; } _single; - struct { GB_TYPE type; double value; } _float; - struct { GB_TYPE type; int date; int time; } _date; - struct { GB_TYPE type; char *value; } _string; - struct { GB_TYPE type; void *value; } _object; + struct { GB_TYPE type; int value; } PACKED _boolean; + struct { GB_TYPE type; int value; } PACKED _byte; + struct { GB_TYPE type; int value; } PACKED _short; + struct { GB_TYPE type; int value; } PACKED _integer; + struct { GB_TYPE type; int64_t value; } PACKED _long; + struct { GB_TYPE type; double value; } PACKED _single; + struct { GB_TYPE type; double value; } PACKED _float; + struct { GB_TYPE type; int date; int time; } PACKED _date; + struct { GB_TYPE type; char *value; } PACKED _string; + struct { GB_TYPE type; void *value; } PACKED _object; } GB_VARIANT_VALUE; @@ -145,6 +149,7 @@ typedef intptr_t _reserved; #endif } + PACKED GB_STRING; @@ -159,6 +164,7 @@ typedef #endif intptr_t _reserved[2]; } + PACKED GB_INTEGER; @@ -174,6 +180,7 @@ typedef int _reserved; #endif } + PACKED GB_LONG; @@ -185,6 +192,7 @@ typedef intptr_t value; intptr_t _reserved[2]; } + PACKED GB_POINTER; @@ -199,6 +207,7 @@ typedef #endif intptr_t _reserved[2]; } + PACKED GB_BOOLEAN; @@ -207,13 +216,16 @@ typedef typedef struct { GB_TYPE type; + #if __WORDSIZE == 64 + #else + int _pad; + #endif double value; #if __WORDSIZE == 64 intptr_t _reserved[2]; - #else - int _reserved; #endif } + PACKED GB_FLOAT; @@ -236,6 +248,7 @@ typedef int _reserved; #endif } + PACKED GB_DATE; @@ -247,6 +260,7 @@ typedef void *value; intptr_t _reserved[2]; } + PACKED GB_OBJECT;