Permalink
Browse files

Merge pull request #367 from shamanas/patch-4

Closes #351
  • Loading branch information...
2 parents 705f770 + 0d43c24 commit 1278e0b6d01f2561752c643a6ddf6a059a7ef55a Amos Wenger committed Apr 25, 2012
Showing with 4 additions and 6 deletions.
  1. +4 −6 sdk/lang/Array.h
View
10 sdk/lang/Array.h
@@ -1,4 +1,3 @@
-
#ifndef ___lang_array___
#define ___lang_array___
@@ -22,11 +21,10 @@
((type* restrict) array.data)[index])
#define _lang_array__Array_set(array, index, type, value) \
- if(index < 0 || index >= array.length) { \
- lang_Exception__Exception_throw((lang_Exception__Exception *) lang_Exception__OutOfBoundsException_new_noOrigin(index, array.length)); \
- exit(1); \
- } \
- ((type* restrict) array.data)[index] = value;
+ (index < 0 || index >= array.length) ? \
+ lang_Exception__Exception_throw((lang_Exception__Exception *) lang_Exception__OutOfBoundsException_new_noOrigin(index, array.length)), \
+ *((type*) NULL) : \
+ (((type* restrict) array.data)[index] = value)
#define _lang_array__Array_free(array) { array_free(array.data) }

0 comments on commit 1278e0b

Please sign in to comment.