Kirill Simonov avatar Kirill Simonov committed 635552a

Add win32 fixes and project files for VC6.

Comments (0)

Files changed (10)

 yaml_string_extend(yaml_char_t **start,
         yaml_char_t **pointer, yaml_char_t **end)
 {
-    void *new_start = yaml_realloc(*start, (*end - *start)*2);
+    yaml_char_t *new_start = yaml_realloc(*start, (*end - *start)*2);
 
     if (!new_start) return 0;
 
 YAML_DECLARE(int)
 yaml_stack_extend(void **start, void **top, void **end)
 {
-    void *new_start = yaml_realloc(*start, (*end - *start)*2);
+    void *new_start = yaml_realloc(*start, ((char *)*end - (char *)*start)*2);
 
     if (!new_start) return 0;
 
-    *top = new_start + (*top - *start);
-    *end = new_start + (*end - *start)*2;
+    *top = (char *)new_start + ((char *)*top - (char *)*start);
+    *end = (char *)new_start + ((char *)*end - (char *)*start)*2;
     *start = new_start;
 
     return 1;
     /* Check if we need to resize the queue. */
 
     if (*start == *head && *tail == *end) {
-        void *new_start = yaml_realloc(*start, (*end - *start)*2);
+        void *new_start = yaml_realloc(*start,
+                ((char *)*end - (char *)*start)*2);
 
         if (!new_start) return 0;
 
-        *head = new_start + (*head - *start);
-        *tail = new_start + (*tail - *start);
-        *end = new_start + (*end - *start)*2;
+        *head = (char *)new_start + ((char *)*head - (char *)*start);
+        *tail = (char *)new_start + ((char *)*tail - (char *)*start);
+        *end = (char *)new_start + ((char *)*end - (char *)*start)*2;
         *start = new_start;
     }
 
 
     if (*tail == *end) {
         if (*head != *tail) {
-            memmove(*start, *head, *tail - *head);
+            memmove(*start, *head, (char *)*tail - (char *)*head);
         }
-        *tail -= *head - *start;
+        *tail = (char *)*tail - (char *)*head + (char *)*start;
         *head = *start;
     }
 
         return 1;
     }
 
-    if (size > (parser->input.string.end - parser->input.string.current)) {
+    if (size > (size_t)(parser->input.string.end
+                - parser->input.string.current)) {
         size = parser->input.string.end - parser->input.string.current;
     }
 
         unsigned char octet;
         unsigned int width;
         unsigned int value;
-        int k;
+        size_t k;
 
         octet = pointer[0];
         width = (octet & 0x80) == 0x00 ? 1 :
 {
     struct {
         yaml_error_type_t error;
-    } context;
+    } context = { YAML_NO_ERROR };
     yaml_tag_directive_t *tag_directive;
 
     assert(document);   /* Non-NULL document object is expected. */
     return 1;
 }
 
+
     for (tag_directive = emitter->tag_directives.start;
             tag_directive != emitter->tag_directives.top; tag_directive ++) {
         size_t prefix_length = strlen((char *)tag_directive->prefix);
-        if (prefix_length < (string.end - string.start)
+        if (prefix_length < (size_t)(string.end - string.start)
                 && strncmp((char *)tag_directive->prefix, (char *)string.start,
                     prefix_length) == 0)
         {
             unsigned char octet;
             unsigned int width;
             unsigned int value;
-            int k;
+            size_t k;
 
             octet = string.pointer[0];
             width = (octet & 0x80) == 0x00 ? 1 :
 yaml_parser_register_anchor(yaml_parser_t *parser,
         int index, yaml_char_t *anchor)
 {
-    yaml_alias_data_t data = { anchor, index,
-        parser->document->nodes.start[index-1].start_mark };
+    yaml_alias_data_t data = { anchor, index, { 0, 0, 0 } };
     yaml_alias_data_t *alias_data;
 
     if (!anchor) return 1;
 
+    data.mark = parser->document->nodes.start[index-1].start_mark;
+
     for (alias_data = parser->aliases.start;
             alias_data != parser->aliases.top; alias_data ++) {
         if (strcmp((char *)alias_data->anchor, (char *)anchor) == 0) {
             int incomplete = 0;
             unsigned char octet;
             unsigned int width = 0;
-            int k, low, high;
-            int raw_unread = parser->raw_buffer.last - parser->raw_buffer.pointer;
+            int low, high;
+            size_t k;
+            size_t raw_unread = parser->raw_buffer.last - parser->raw_buffer.pointer;
 
             /* Decode the next character. */
 
      */
 
     int required = (!parser->flow_level
-            && parser->indent == parser->mark.column);
+            && parser->indent == (int)parser->mark.column);
 
     /*
      * A simple key is required only when it is the first token in the current
     {
         yaml_simple_key_t simple_key = { 1, required,
             parser->tokens_parsed + parser->tokens.tail - parser->tokens.head,
-            parser->mark };
+            { 0, 0, 0 } };
+        simple_key.mark = parser->mark;
 
         if (!yaml_parser_remove_simple_key(parser)) return 0;
 
 
     /* Resize the string to include the head. */
 
-    while (string.end - string.start <= length) {
+    while (string.end - string.start <= (int)length) {
         if (!yaml_string_extend(&string.start, &string.pointer, &string.end)) {
             parser->error = YAML_MEMORY_ERROR;
             goto error;
 
     if (!CACHE(parser, 1)) goto error;
 
-    while (parser->mark.column == indent && !IS_Z(parser->buffer))
+    while ((int)parser->mark.column == indent && !IS_Z(parser->buffer))
     {
         /*
          * We are at the beginning of a non-empty line.
 
         if (!CACHE(parser, 1)) return 0;
 
-        while ((!*indent || parser->mark.column < *indent)
+        while ((!*indent || (int)parser->mark.column < *indent)
                 && IS_SPACE(parser->buffer)) {
             SKIP(parser);
             if (!CACHE(parser, 1)) return 0;
         }
 
-        if (parser->mark.column > max_indent)
-            max_indent = parser->mark.column;
+        if ((int)parser->mark.column > max_indent)
+            max_indent = (int)parser->mark.column;
 
         /* Check for a tab character messing the intendation. */
 
-        if ((!*indent || parser->mark.column < *indent)
+        if ((!*indent || (int)parser->mark.column < *indent)
                 && IS_TAB(parser->buffer)) {
             return yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
                     start_mark, "found a tab character where an intendation space is expected");
 
             else if (!single && CHECK(parser->buffer, '\\'))
             {
-                int code_length = 0;
+                size_t code_length = 0;
 
                 if (!STRING_EXTEND(parser, string)) goto error;
 
                 if (code_length)
                 {
                     unsigned int value = 0;
-                    int k;
+                    size_t k;
 
                     /* Scan the character value. */
 
             {
                 /* Check for tab character that abuse intendation. */
 
-                if (leading_blanks && parser->mark.column < indent
+                if (leading_blanks && (int)parser->mark.column < indent
                         && IS_TAB(parser->buffer)) {
                     yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
                             start_mark, "found a tab character that violate intendation");
 
         /* Check intendation level. */
 
-        if (!parser->flow_level && parser->mark.column < indent)
+        if (!parser->flow_level && (int)parser->mark.column < indent)
             break;
     }
 
         unsigned char octet;
         unsigned int width;
         unsigned int value;
-        int k;
+        size_t k;
 
         /* 
          * See the "reader.c" code for more details on UTF-8 encoding.  Note
+#define YAML_VERSION_MAJOR 0
+#define YAML_VERSION_MINOR 0
+#define YAML_VERSION_PATCH 1
+#define YAML_VERSION_STRING "0.0.1"

win32/vc6/libyaml.dsw

+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "yaml"=".\yaml\yaml.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "yamldll"=".\yamldll\yamldll.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+

win32/vc6/yaml/yaml.dsp

+# Microsoft Developer Studio Project File - Name="yaml" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=yaml - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "yaml.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "yaml.mak" CFG="yaml - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "yaml - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "yaml - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "yaml - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "..\.." /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D "YAML_DECLARE_STATIC" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF  "$(CFG)" == "yaml - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /D "YAML_DECLARE_STATIC" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF 
+
+# Begin Target
+
+# Name "yaml - Win32 Release"
+# Name "yaml - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\src\api.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\dumper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\emitter.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\loader.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\parser.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\reader.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\scanner.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\writer.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\config.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\include\yaml.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\yaml_private.h
+# End Source File
+# End Group
+# End Target
+# End Project

win32/vc6/yamldll/yamldll.dsp

+# Microsoft Developer Studio Project File - Name="yamldll" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=yamldll - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "yamldll.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "yamldll.mak" CFG="yamldll - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "yamldll - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "yamldll - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "yamldll - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "YAMLDLL_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HAVE_CONFIG_H" /D "YAML_DECLARE_EXPORT" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+
+!ELSEIF  "$(CFG)" == "yamldll - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "YAMLDLL_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HAVE_CONFIG_H" /D "YAML_DECLARE_EXPORT" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "yamldll - Win32 Release"
+# Name "yamldll - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\src\api.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\dumper.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\emitter.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\loader.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\parser.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\reader.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\scanner.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\writer.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\config.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\include\yaml.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\src\yaml_private.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.