set the source position of an call expression
[cparser] / types.c
diff --git a/types.c b/types.c
index 7aed56e..6ac6f59 100644 (file)
--- a/types.c
+++ b/types.c
@@ -1,3 +1,22 @@
+/*
+ * This file is part of cparser.
+ * Copyright (C) 2007-2008 Matthias Braun <matze@braunis.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
 #include "type_t.h"
 #include "types.h"
 
@@ -13,12 +32,12 @@ type_t *type_long_long;
 type_t *type_long;
 type_t *type_short;
 type_t *type_signed_char;
-type_t *type_string;
 type_t *type_unsigned_int;
 type_t *type_unsigned_long_long;
 type_t *type_unsigned_long;
 type_t *type_void;
 
+type_t *type_char_ptr;
 type_t *type_int_ptr;
 type_t *type_long_long_ptr;
 type_t *type_long_ptr;
@@ -26,6 +45,8 @@ type_t *type_short_ptr;
 type_t *type_signed_char_ptr;
 type_t *type_void_ptr;
 
+type_t *type_char_ptr_ptr;
+
 type_t *type_intmax_t;
 type_t *type_ptrdiff_t;
 type_t *type_size_t;
@@ -40,10 +61,20 @@ type_t *type_ptrdiff_t_ptr;
 type_t *type_ssize_t_ptr;
 type_t *type_wchar_t_ptr;
 
+/* microsoft types */
+type_t *type_int8;
+type_t *type_int16;
+type_t *type_int32;
+type_t *type_int64;
+type_t *type_unsigned_int8;
+type_t *type_unsigned_int16;
+type_t *type_unsigned_int32;
+type_t *type_unsigned_int64;
+
 
 void init_basic_types(void)
 {
-       static const type_base_t error = { TYPE_ERROR, TYPE_QUALIFIER_NONE, NULL };
+       static const type_base_t error = { TYPE_ERROR, TYPE_QUALIFIER_NONE, 0, { NULL, 0 }, NULL };
 
        type_error_type         = (type_t*)&error;
        type_signed_char        = make_atomic_type(ATOMIC_TYPE_SCHAR,       TYPE_QUALIFIER_NONE);
@@ -60,11 +91,24 @@ void init_basic_types(void)
        type_char               = make_atomic_type(ATOMIC_TYPE_CHAR,        TYPE_QUALIFIER_NONE);
        type_void               = make_atomic_type(ATOMIC_TYPE_VOID,        TYPE_QUALIFIER_NONE);
 
+       /* microsoft types */
+       type_int8               = make_atomic_type(ATOMIC_TYPE_CHAR,        TYPE_QUALIFIER_NONE);
+       type_int16              = make_atomic_type(ATOMIC_TYPE_SHORT,       TYPE_QUALIFIER_NONE);
+       type_int32              = make_atomic_type(ATOMIC_TYPE_INT,         TYPE_QUALIFIER_NONE);
+       type_int64              = make_atomic_type(ATOMIC_TYPE_LONGLONG,    TYPE_QUALIFIER_NONE);
+       type_unsigned_int8      = make_atomic_type(ATOMIC_TYPE_UCHAR,       TYPE_QUALIFIER_NONE);
+       type_unsigned_int16     = make_atomic_type(ATOMIC_TYPE_USHORT,      TYPE_QUALIFIER_NONE);
+       type_unsigned_int32     = make_atomic_type(ATOMIC_TYPE_UINT,        TYPE_QUALIFIER_NONE);
+       type_unsigned_int64     = make_atomic_type(ATOMIC_TYPE_ULONGLONG,   TYPE_QUALIFIER_NONE);
+
+       /* pointer types */
        type_void_ptr           = make_pointer_type(type_void,              TYPE_QUALIFIER_NONE);
-       type_string             = make_pointer_type(type_char,              TYPE_QUALIFIER_NONE);
+       type_char_ptr           = make_pointer_type(type_char,              TYPE_QUALIFIER_NONE);
        type_signed_char_ptr    = make_pointer_type(type_signed_char,       TYPE_QUALIFIER_NONE);
        type_short_ptr          = make_pointer_type(type_short,             TYPE_QUALIFIER_NONE);
        type_int_ptr            = make_pointer_type(type_int,               TYPE_QUALIFIER_NONE);
        type_long_ptr           = make_pointer_type(type_long,              TYPE_QUALIFIER_NONE);
        type_long_long_ptr      = make_pointer_type(type_long_long,         TYPE_QUALIFIER_NONE);
+
+       type_char_ptr_ptr       = make_pointer_type(type_char_ptr,          TYPE_QUALIFIER_NONE);
 }