Eliminate calls to abort()
Call Exit(EXIT_FAILURE) instead so that output files get removed.
This commit is contained in:
parent
55377bdc08
commit
735732d721
6 changed files with 35 additions and 52 deletions
|
|
@ -18,10 +18,6 @@
|
|||
* DohDelete()
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
#ifndef SWIG_DEBUG_DELETE
|
||||
#define SWIG_DEBUG_DELETE 0
|
||||
#endif
|
||||
|
||||
void DohDelete(DOH *obj) {
|
||||
DohBase *b = (DohBase *) obj;
|
||||
DohObjInfo *objinfo;
|
||||
|
|
@ -29,13 +25,8 @@ void DohDelete(DOH *obj) {
|
|||
if (!obj)
|
||||
return;
|
||||
if (!DohCheck(b)) {
|
||||
#if SWIG_DEBUG_DELETE
|
||||
fputs("DOH: Fatal error. Attempt to delete a non-doh object.\n", stderr);
|
||||
abort();
|
||||
#else
|
||||
assert(0);
|
||||
#endif
|
||||
return;
|
||||
fputs("Fatal internal error: Attempt to delete a non-DOH object.\n", stderr);
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
if (b->flag_intern)
|
||||
return;
|
||||
|
|
@ -64,13 +55,8 @@ DOH *DohCopy(const DOH *obj) {
|
|||
if (!obj)
|
||||
return 0;
|
||||
if (!DohCheck(b)) {
|
||||
#if SWIG_DEBUG_DELETE
|
||||
fputs("DOH: Fatal error. Attempt to copy a non-doh object.\n", stderr);
|
||||
abort();
|
||||
#else
|
||||
assert(0);
|
||||
#endif
|
||||
return 0;
|
||||
fputs("Fatal internal error: Attempt to copy a non-DOH object.\n", stderr);
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
objinfo = b->type;
|
||||
if (objinfo->doh_copy) {
|
||||
|
|
|
|||
|
|
@ -476,7 +476,8 @@ public:
|
|||
Printf(f_init, "}\n");
|
||||
break;
|
||||
default:
|
||||
abort(); // for now
|
||||
fputs("Fatal internal error: Invalid Guile linkage setting.\n", stderr);
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (scmstub) {
|
||||
|
|
|
|||
|
|
@ -398,26 +398,18 @@ public:
|
|||
*/
|
||||
|
||||
void oc_SwigType_del_reference(SwigType *t) {
|
||||
char *c = Char(t);
|
||||
if (strncmp(c, "q(", 2) == 0) {
|
||||
Delete(SwigType_pop(t));
|
||||
c = Char(t);
|
||||
if (SwigType_isqualifier(t)) {
|
||||
SwigType_del_qualifier(t);
|
||||
}
|
||||
if (strncmp(c, "r.", 2)) {
|
||||
printf("Fatal error. SwigType_del_pointer applied to non-pointer.\n");
|
||||
abort();
|
||||
}
|
||||
Replace(t, "r.", "", DOH_REPLACE_FIRST);
|
||||
SwigType_del_reference(t);
|
||||
}
|
||||
|
||||
void oc_SwigType_del_array(SwigType *t) {
|
||||
char *c = Char(t);
|
||||
if (strncmp(c, "q(", 2) == 0) {
|
||||
Delete(SwigType_pop(t));
|
||||
c = Char(t);
|
||||
if (SwigType_isqualifier(t)) {
|
||||
SwigType_del_qualifier(t);
|
||||
}
|
||||
if (strncmp(c, "a(", 2) == 0) {
|
||||
Delete(SwigType_pop(t));
|
||||
if (SwigType_isarray(t)) {
|
||||
SwigType_del_array(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2055,8 +2055,7 @@ String *Preprocessor_parse(String *s) {
|
|||
break;
|
||||
default:
|
||||
Printf(stderr, "cpp: Invalid parser state %d\n", state);
|
||||
abort();
|
||||
break;
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
while (level > 0) {
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ int Preprocessor_expr(DOH *s, int *error) {
|
|||
|
||||
default:
|
||||
fprintf(stderr, "Internal error in expression evaluator.\n");
|
||||
abort();
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -359,8 +359,8 @@ SwigType *SwigType_del_pointer(SwigType *t) {
|
|||
c++;
|
||||
}
|
||||
if (strncmp(c, "p.", 2)) {
|
||||
printf("Fatal error. SwigType_del_pointer applied to non-pointer.\n");
|
||||
abort();
|
||||
printf("Fatal error: SwigType_del_pointer applied to non-pointer.\n");
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
Delslice(t, 0, (int)((c - s) + 2));
|
||||
return t;
|
||||
|
|
@ -402,9 +402,10 @@ SwigType *SwigType_add_reference(SwigType *t) {
|
|||
|
||||
SwigType *SwigType_del_reference(SwigType *t) {
|
||||
char *c = Char(t);
|
||||
int check = strncmp(c, "r.", 2);
|
||||
assert(check == 0);
|
||||
(void)check;
|
||||
if (strncmp(c, "r.", 2)) {
|
||||
printf("Fatal error: SwigType_del_reference applied to non-reference.\n");
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
Delslice(t, 0, 2);
|
||||
return t;
|
||||
}
|
||||
|
|
@ -438,9 +439,10 @@ SwigType *SwigType_add_rvalue_reference(SwigType *t) {
|
|||
|
||||
SwigType *SwigType_del_rvalue_reference(SwigType *t) {
|
||||
char *c = Char(t);
|
||||
int check = strncmp(c, "z.", 2);
|
||||
assert(check == 0);
|
||||
(void)check;
|
||||
if (strncmp(c, "z.", 2)) {
|
||||
fprintf(stderr, "Fatal error: SwigType_del_rvalue_reference() applied to non-rvalue-reference.\n");
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
Delslice(t, 0, 2);
|
||||
return t;
|
||||
}
|
||||
|
|
@ -643,9 +645,10 @@ SwigType *SwigType_add_array(SwigType *t, const_String_or_char_ptr size) {
|
|||
|
||||
SwigType *SwigType_del_array(SwigType *t) {
|
||||
char *c = Char(t);
|
||||
int check = strncmp(c, "a(", 2);
|
||||
assert(check == 0);
|
||||
(void)check;
|
||||
if (strncmp(c, "a(", 2)) {
|
||||
fprintf(stderr, "Fatal error: SwigType_del_array() applied to non-array.\n");
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
Delslice(t, 0, element_size(c));
|
||||
return t;
|
||||
}
|
||||
|
|
@ -738,8 +741,10 @@ void SwigType_array_setdim(SwigType *t, int n, const_String_or_char_ptr rep) {
|
|||
char *c = Char(t);
|
||||
|
||||
start = c;
|
||||
if (strncmp(c, "a(", 2))
|
||||
abort();
|
||||
if (strncmp(c, "a(", 2)) {
|
||||
fprintf(stderr, "Fatal error: SwigType_array_type applied to non-array.\n");
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
while (c && (strncmp(c, "a(", 2) == 0) && (n > 0)) {
|
||||
c = strchr(c, '.');
|
||||
|
|
@ -831,8 +836,8 @@ SwigType *SwigType_pop_function(SwigType *t) {
|
|||
c = Char(t);
|
||||
}
|
||||
if (strncmp(c, "f(", 2)) {
|
||||
printf("Fatal error. SwigType_pop_function applied to non-function.\n");
|
||||
abort();
|
||||
fprintf(stderr, "Fatal error. SwigType_pop_function applied to non-function.\n");
|
||||
Exit(EXIT_FAILURE);
|
||||
}
|
||||
g = SwigType_pop(t);
|
||||
if (f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue