proper constraints return values


git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@194 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/tests/50-constraint-OK.asn1.-P b/tests/50-constraint-OK.asn1.-P
index 38416db..6fca2aa 100644
--- a/tests/50-constraint-OK.asn1.-P
+++ b/tests/50-constraint-OK.asn1.-P
@@ -140,7 +140,7 @@
 	
 	if((value >= 0)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -259,7 +259,7 @@
 	
 	if((value >= 0 && value <= 10)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -491,7 +491,7 @@
 	
 	if((value == 5)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -810,9 +810,9 @@
 	
 	for(; ch < end; ch++) {
 		uint8_t cv = *ch;
-		if(!(cv <= 127)) return 0;
+		if(!(cv <= 127)) return -1;
 	}
-	return 1;
+	return 0;
 }
 
 
@@ -836,7 +836,7 @@
 	if(((size <= 20) || (size >= 25 && size <= 30))
 		 && check_permitted_alphabet_1(sptr)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -953,9 +953,9 @@
 	
 	for(; ch < end; ch++) {
 		uint8_t cv = *ch;
-		if(!table[cv]) return 0;
+		if(!table[cv]) return -1;
 	}
-	return 1;
+	return 0;
 }
 
 
@@ -979,7 +979,7 @@
 	if(((size >= 10 && size <= 20) || (size >= 25 && size <= 27))
 		 && check_permitted_alphabet_2(sptr)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -1085,9 +1085,9 @@
 	
 	for(; ch < end; ch++) {
 		uint8_t cv = *ch;
-		if(!(cv >= 65 && cv <= 70)) return 0;
+		if(!(cv >= 65 && cv <= 70)) return -1;
 	}
-	return 1;
+	return 0;
 }
 
 
@@ -1108,7 +1108,7 @@
 	
 	if(check_permitted_alphabet_3(sptr)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -1214,9 +1214,9 @@
 	
 	for(; ch < end; ch++) {
 		uint8_t cv = *ch;
-		if(!(cv >= 69 && cv <= 70)) return 0;
+		if(!(cv >= 69 && cv <= 70)) return -1;
 	}
-	return 1;
+	return 0;
 }
 
 
@@ -1237,7 +1237,7 @@
 	
 	if(check_permitted_alphabet_4(sptr)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -1343,9 +1343,9 @@
 	
 	for(; ch < end; ch++) {
 		uint8_t cv = *ch;
-		if(!(cv >= 65 && cv <= 70)) return 0;
+		if(!(cv >= 65 && cv <= 70)) return -1;
 	}
-	return 1;
+	return 0;
 }
 
 
@@ -1366,7 +1366,7 @@
 	
 	if(check_permitted_alphabet_5(sptr)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -1698,9 +1698,9 @@
 	
 	for(; ch < end; ch++) {
 		uint8_t cv = *ch;
-		if(!(cv >= 65 && cv <= 70)) return 0;
+		if(!(cv >= 65 && cv <= 70)) return -1;
 	}
-	return 1;
+	return 0;
 }
 
 
@@ -1724,7 +1724,7 @@
 	if((size >= 1 && size <= 4)
 		 && check_permitted_alphabet_6(sptr)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -1830,9 +1830,9 @@
 	
 	for(; ch < end; ch++) {
 		uint8_t cv = *ch;
-		if(!(cv >= 65 && cv <= 68)) return 0;
+		if(!(cv >= 65 && cv <= 68)) return -1;
 	}
-	return 1;
+	return 0;
 }
 
 
@@ -1856,7 +1856,7 @@
 	if((size >= 1 && size <= 4)
 		 && check_permitted_alphabet_7(sptr)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -1962,9 +1962,9 @@
 	
 	for(; ch < end; ch++) {
 		uint8_t cv = *ch;
-		if(!(cv >= 65 && cv <= 70)) return 0;
+		if(!(cv >= 65 && cv <= 70)) return -1;
 	}
-	return 1;
+	return 0;
 }
 
 
@@ -1985,7 +1985,7 @@
 	
 	if(check_permitted_alphabet_8(sptr)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -2103,10 +2103,10 @@
 	
 	for(; ch < end; ch++) {
 		uint8_t cv = *ch;
-		if(cv >= 0x80) return 0;
-		if(!table[cv]) return 0;
+		if(cv >= 0x80) return -1;
+		if(!table[cv]) return -1;
 	}
-	return 1;
+	return 0;
 }
 
 
@@ -2131,7 +2131,7 @@
 	if((size >= 1 && size <= 2)
 		 && check_permitted_alphabet_9(sptr)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);
@@ -2247,7 +2247,7 @@
 	
 	if((size >= 1 && size <= 2)) {
 		/* Constraint check succeeded */
-		return 1;
+		return 0;
 	} else {
 		_ASN_ERRLOG(app_errlog, app_key,
 			"%s: constraint failed", td->name);