X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fopcodes.c;h=838142e253f01761818863eade191b0f48381df4;hb=00b1ceb8ff8d6f6c58134bdce8aa3f7fa5edf041;hp=f8b430234727715fce4e60022f9aa18f24cffd21;hpb=89d0ba3968d36576553e0f483b0c69465f94e8ae;p=mono.git diff --git a/mono/metadata/opcodes.c b/mono/metadata/opcodes.c index f8b43023472..838142e253f 100644 --- a/mono/metadata/opcodes.c +++ b/mono/metadata/opcodes.c @@ -4,7 +4,9 @@ * Author: * Paolo Molaro (lupus@ximian.com) * - * (C) 2002 Ximian, Inc. + * Copyright 2002-2003 Ximian, Inc (http://www.ximian.com) + * Copyright 2004-2009 Novell, Inc (http://www.novell.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include #include /* for NULL */ @@ -36,7 +38,7 @@ static const struct msgstr_t { #include "mono/cil/opcode.def" #undef OPDEF }; -static const gint16 opidx [] = { +static const int16_t opidx [] = { #define OPDEF(a,b,c,d,e,f,g,h,i,j) [MONO_ ## a] = offsetof (struct msgstr_t, MSGSTRFIELD(__LINE__)), #include "mono/cil/opcode.def" #undef OPDEF @@ -65,25 +67,25 @@ mono_opcode_name (int opcode) #endif MonoOpcodeEnum -mono_opcode_value (const guint8 **ip, const guint8 *end) +mono_opcode_value (const mono_byte **ip, const mono_byte *end) { MonoOpcodeEnum res; - const guint8 *p = *ip; + const mono_byte *p = *ip; if (p >= end) - return -1; + return (MonoOpcodeEnum)-1; if (*p == 0xfe) { ++p; if (p >= end) - return -1; - res = *p + MONO_PREFIX1_OFFSET; + return (MonoOpcodeEnum)-1; + res = (MonoOpcodeEnum)(*p + MONO_PREFIX1_OFFSET); } else if (*p == MONO_CUSTOM_PREFIX) { ++p; if (p >= end) - return -1; - res = *p + MONO_CUSTOM_PREFIX_OFFSET; + return (MonoOpcodeEnum)-1; + res = (MonoOpcodeEnum)(*p + MONO_CUSTOM_PREFIX_OFFSET); } else { - res = *p; + res = (MonoOpcodeEnum)*p; } *ip = p; return res;