Browse Source

rename all stb_sprintf identifiers to follow stb conventions

Sean Barrett 8 năm trước cách đây
mục cha
commit
c9fe5bac48
6 tập tin đã thay đổi với 291 bổ sung256 xóa
  1. 1 0
      stb.h
  2. 267 256
      stb_sprintf.h
  3. 3 0
      tests/grid_reachability.c
  4. 4 0
      tests/stb.dsp
  5. 12 0
      tests/test_c_compilation.c
  6. 4 0
      tests/test_cpp_compilation.cpp

+ 1 - 0
stb.h

@@ -730,6 +730,7 @@ STB_EXTERN int  stb_snprintf(char *s, size_t n, const char *fmt, ...);
 STB_EXTERN int  stb_vsnprintf(char *s, size_t n, const char *fmt, va_list v);
 
 #ifdef STB_DEFINE
+
 int stb_vsnprintf(char *s, size_t n, const char *fmt, va_list v)
 {
    int res;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 267 - 256
stb_sprintf.h


+ 3 - 0
tests/grid_reachability.c

@@ -143,6 +143,8 @@ void end_timer(void)
    printf("%6.4lf ms: %s\n", tm * 1000, message);
 }
 
+extern void quicktest(void);
+
 int loc[5000][2];
 int main(int argc, char **argv)
 {
@@ -152,6 +154,7 @@ int main(int argc, char **argv)
    uint8 *map = stbi_load("data/map_03.png", &w, &h, 0, 1);
 
    assert(map);
+   quicktest();
 
    for (j=0; j < h; ++j)
       for (i=0; i < w; ++i)

+ 4 - 0
tests/stb.dsp

@@ -154,6 +154,10 @@ SOURCE=..\stb_rect_pack.h
 # End Source File
 # Begin Source File
 
+SOURCE=..\stb_sprintf.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\stb_textedit.h
 # End Source File
 # Begin Source File

+ 12 - 0
tests/test_c_compilation.c

@@ -1,3 +1,7 @@
+#include "stb_sprintf.h"
+#define STB_SPRINTF_IMPLEMENTATION
+#include "stb_sprintf.h"
+
 #define STB_PERLIN_IMPLEMENTATION
 #define STB_IMAGE_WRITE_IMPLEMENTATION
 #define STB_DXT_IMPLEMENATION
@@ -28,3 +32,11 @@
 #define STBTE_DRAW_TILE(x,y,id,highlight,data)  0
 #define STB_TILEMAP_EDITOR_IMPLEMENTATION
 #include "stb_tilemap_editor.h"
+
+
+int quicktest(void)
+{
+   char buffer[999];
+   stbsp_sprintf(buffer, "test%%test");
+   return 0;
+}

+ 4 - 0
tests/test_cpp_compilation.cpp

@@ -1,3 +1,7 @@
+#include "stb_sprintf.h"
+#define STB_SPRINTF_IMPLEMENTATION
+#include "stb_sprintf.h"
+
 #define STB_TRUETYPE_IMPLEMENTATION
 #define STB_PERLIN_IMPLEMENTATION
 #define STB_IMAGE_WRITE_IMPLEMENTATION

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác