From d8d30b403b76e0a806a98aefc13a8f20656ca1c9 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 13 May 1991 10:08:54 +0000 Subject: [PATCH] Fixed a cast bug (unsigned to unsigned char) --- lang/cem/cemcom.ansi/conversion.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lang/cem/cemcom.ansi/conversion.c b/lang/cem/cemcom.ansi/conversion.c index 22e86912c..381912fee 100644 --- a/lang/cem/cemcom.ansi/conversion.c +++ b/lang/cem/cemcom.ansi/conversion.c @@ -38,10 +38,9 @@ conversion(from_type, to_type) int to_cnvtype = convtype(to_type); if ((int)to_size < (int)word_size) to_size = word_size; - if ((int)from_size == (int)to_size && from_cnvtype == to_cnvtype) - return; - switch (from_cnvtype) { - case T_SIGNED: + if ((int)from_size != (int)to_size || from_cnvtype != to_cnvtype) { + switch (from_cnvtype) { + case T_SIGNED: switch (to_cnvtype) { case T_SIGNED: C_loc(from_size); @@ -71,7 +70,7 @@ conversion(from_type, to_type) break; } break; - case T_UNSIGNED: + case T_UNSIGNED: if ((int)from_size < (int)word_size) from_size = word_size; C_loc(from_size); C_loc(to_size); @@ -87,7 +86,7 @@ conversion(from_type, to_type) break; } break; - case T_FLOATING: + case T_FLOATING: C_loc(from_size); C_loc(to_size); switch (to_cnvtype) { @@ -102,9 +101,10 @@ conversion(from_type, to_type) break; } break; - default: + default: crash("(conversion) illegal type conversion"); /*NOTREACHED*/ + } } if ((int)(to_type->tp_size) < (int)word_size && to_cnvtype != T_FLOATING -- 2.34.1