/* */
/* */
/* */
-/* (C) 2000-2009, Ullrich von Bassewitz */
+/* (C) 2000-2012, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* Disallow ASM statements on global level */
if (CurTok.Tok == TOK_ASM) {
- Error ("__asm__ is not allowed here");
+ Error ("__asm__ is not allowed here");
/* Parse and remove the statement for error recovery */
AsmStatement ();
ConsumeSemi ();
* the element qualifiers, since not the array but its
* elements are const.
*/
- if (IsQualConst (Decl.Type) ||
- (IsTypeArray (Decl.Type) &&
- IsQualConst (GetElementType (Decl.Type)))) {
+ if (IsQualConst (GetBaseElementType (Decl.Type))) {
g_userodata ();
} else {
g_usedata ();
/* */
/* */
/* */
-/* (C) 1998-2008 Ullrich von Bassewitz */
-/* Roemerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
+/* (C) 1998-2012, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
+Type* GetBaseElementType (Type* T)
+/* Return the base element type of a given type. If T is not an array, this
+ * will return. Otherwise it will return the base element type, which means
+ * the element type that is not an array.
+ */
+{
+ while (IsTypeArray (T)) {
+ ++T;
+ }
+ return T;
+}
+
+
+
SymEntry* GetSymEntry (const Type* T)
/* Return a SymEntry pointer from a type */
{
/* */
/* */
/* */
-/* (C) 1998-2010, Ullrich von Bassewitz */
+/* (C) 1998-2012, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
Type* GetElementType (Type* T);
/* Return the element type of the given array type. */
+Type* GetBaseElementType (Type* T);
+/* Return the base element type of a given type. If T is not an array, this
+ * will return. Otherwise it will return the base element type, which means
+ * the element type that is not an array.
+ */
+
struct SymEntry* GetSymEntry (const Type* T) attribute ((const));
/* Return a SymEntry pointer from a type */
if (CurTok.Tok == TOK_ASSIGN) {
/* Initialization ahead, switch to data segment and define a label.
- * For arrays, we need to check the elements of the array for
+ * For arrays, we need to check the elements of the array for
* constness, not the array itself.
*/
- if (IsQualConst (Decl->Type) ||
- (IsTypeArray (Decl->Type) && IsQualConst (GetElementType (Decl->Type)))) {
+ if (IsQualConst (GetBaseElementType (Decl->Type))) {
SymData = AllocLabel (g_userodata);
} else {
SymData = AllocLabel (g_usedata);