Permalink
Browse files

Fix warnings reported by clang.

  • Loading branch information...
1 parent df6eff2 commit 1cdafa6797495b40ec0f9dde1a86d614a9d0d6c6 @vargaz vargaz committed Feb 29, 2012
View
@@ -290,7 +290,7 @@ g_utf8_find_prev_char (const gchar *str, const gchar *p)
{
while (p > str) {
p--;
- if ((*p && 0xc0) != 0xb0)
+ if ((*p & 0xc0) != 0xb0)
return (gchar *)p;
}
return NULL;
@@ -648,8 +648,6 @@ _mono_debug_address_from_il_offset (MonoDebugMethodJitInfo *jit, uint32_t il_off
for (i = jit->num_line_numbers - 1; i >= 0; i--) {
MonoDebugLineNumberEntry lne = jit->line_numbers [i];
- if (lne.il_offset < 0)
- continue;
if (lne.il_offset <= il_offset)
return lne.native_offset;
}
View
@@ -2074,7 +2074,7 @@ mono_domain_free (MonoDomain *domain, gboolean force)
mono_perfcounters->loader_appdomains--;
- if ((domain == mono_root_domain))
+ if (domain == mono_root_domain)
mono_root_domain = NULL;
}
@@ -137,7 +137,7 @@ mono_g_hash_table_new_type (GHashFunc hash_func, GEqualFunc key_equal_func, Mono
hash->gc_type = type;
#ifdef HAVE_SGEN_GC
- if (type < 0 || type > MONO_HASH_KEY_VALUE_GC)
+ if (type > MONO_HASH_KEY_VALUE_GC)
g_error ("wrong type for gc hashtable");
/*
* We use a user defined marking function to avoid having to register a GC root for
View
@@ -5191,7 +5191,7 @@ mono_object_isinst_mbyref (MonoObject *obj, MonoClass *klass)
return obj;
} else {
MonoClass *oklass = vt->klass;
- if ((oklass == mono_defaults.transparent_proxy_class))
+ if (oklass == mono_defaults.transparent_proxy_class)
oklass = ((MonoTransparentProxy *)obj)->remote_class->proxy_class;
mono_class_setup_supertypes (klass);
@@ -4930,7 +4930,7 @@ mono_image_create_token (MonoDynamicImage *assembly, MonoObject *obj,
if (tb->generic_params) {
token = mono_image_get_generic_field_token (assembly, fb);
} else {
- if ((tb->module->dynamic_image == assembly)) {
+ if (tb->module->dynamic_image == assembly) {
token = fb->table_idx | MONO_TOKEN_FIELD_DEF;
} else {
token = mono_image_get_fieldref_token (assembly, (MonoObject*)fb, fb->handle);
View
@@ -830,7 +830,7 @@ mono_sgen_scan_area_with_callback (char *start, char *end, IterateObjectCallback
size = ALIGN_UP (safe_object_get_size ((MonoObject*)obj));
- if (SGEN_LOAD_VTABLE (obj) != array_fill_vtable)
+ if ((MonoVTable*)SGEN_LOAD_VTABLE (obj) != array_fill_vtable)
callback (obj, size, data);
start += size;
@@ -83,7 +83,7 @@ tp_poll_modify (gpointer event_data, int fd, int operation, int events, gboolean
INIT_POLLFD (&data->newpfd, GPOINTER_TO_INT (fd), events);
*msg = (char) operation;
#ifndef HOST_WIN32
- if (write (data->pipe [1], msg, 1));
+ write (data->pipe [1], msg, 1);
#else
send ((SOCKET) data->pipe [1], msg, 1, 0);
#endif

0 comments on commit 1cdafa6

Please sign in to comment.