[profiler] Split method_leave callback into a method_tail_call callback.
[mono.git] / eglib / src / gpattern.c
index d8e0b791b5458939a9e3a1bfcd277fb8cf6845a5..84861412e8ae05ac67fd6e84b39bd4ee68ab26a6 100644 (file)
 #include <glib.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <errno.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
 
 typedef enum {
        MATCH_LITERAL,
        MATCH_ANYCHAR,
        MATCH_ANYTHING,
-       MATCH_ANYTHING_END
+       MATCH_ANYTHING_END,
+       MATCH_INVALID = -1
 } MatchType;
 
 typedef struct {
@@ -51,10 +54,10 @@ static GSList *
 compile_pattern (const gchar *pattern)
 {
        GSList *list;
-       gint i, len;
+       size_t i, len;
        PData *data;
        gchar c;
-       MatchType last = -1;
+       MatchType last = MATCH_INVALID;
        GString *str;
        gboolean free_str;
 
@@ -155,9 +158,9 @@ g_pattern_spec_free (GPatternSpec *pspec)
 }
 
 static gboolean
-match_string (GSList *list, const gchar *str, gint idx, gint max)
+match_string (GSList *list, const gchar *str, size_t idx, size_t max)
 {
-       gint len;
+       size_t len;
 
        while (list && idx < max) {
                PData *data = (PData *) list->data;
@@ -207,3 +210,4 @@ g_pattern_match_string (GPatternSpec *pspec, const gchar *string)
        return match_string (pspec->pattern, string, 0, strlen (string));
 }
 
+