[io-layer] Remove wait.h
[mono.git] / mono / metadata / seq-points-data.c
index b8b1bcdb6f45dc7115067857bf3362efe2c8cd13..4f996c727d73161c972cb8a5af4fcfef55060258 100644 (file)
@@ -372,7 +372,7 @@ mono_seq_point_data_init (SeqPointData *data, int entry_capacity)
 {
        data->entry_count = 0;
        data->entry_capacity = entry_capacity;
-       data->entries = g_malloc (sizeof (SeqPointDataEntry) * entry_capacity);
+       data->entries = (SeqPointDataEntry *)g_malloc (sizeof (SeqPointDataEntry) * entry_capacity);
 }
 
 void
@@ -402,7 +402,7 @@ mono_seq_point_data_read (SeqPointData *data, char *path)
        fsize = ftell(f);
        fseek(f, 0, SEEK_SET);
 
-       buffer_orig = buffer = g_malloc(fsize + 1);
+       buffer_orig = buffer = (guint8 *)g_malloc (fsize + 1);
        fread(buffer_orig, fsize, 1, f);
        fclose(f);
 
@@ -438,7 +438,7 @@ mono_seq_point_data_write (SeqPointData *data, char *path)
        // Add size of entry_count and native_base_offsets
        size += 4 + data->entry_count * 4;
 
-       buffer_orig = buffer = g_malloc (size);
+       buffer_orig = buffer = (guint8 *)g_malloc (size);
 
        encode_var_int (buffer, &buffer, data->entry_count);
 
@@ -450,6 +450,7 @@ mono_seq_point_data_write (SeqPointData *data, char *path)
 
        fwrite (buffer_orig, 1, buffer - buffer_orig, f);
        g_free (buffer_orig);
+       fclose (f);
 
        return TRUE;
 }