Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
933a1fdd
S
stb
项目概览
itdan3344
/
stb
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
stb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
933a1fdd
编写于
12月 18, 2014
作者:
T
T. J. Moran
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add explicit wchar_t casts in stb.h
上级
f547761c
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
stb.h
stb.h
+13
-13
未找到文件。
stb.h
浏览文件 @
933a1fdd
...
@@ -851,7 +851,7 @@ void stbprint(const char *fmt, ...)
...
@@ -851,7 +851,7 @@ void stbprint(const char *fmt, ...)
#ifdef _WIN32
#ifdef _WIN32
#define stb__fopen(x,y) _wfopen(
stb__from_utf8(x),
stb__from_utf8_alt(y))
#define stb__fopen(x,y) _wfopen(
(const wchar_t *)stb__from_utf8(x), (const wchar_t *)
stb__from_utf8_alt(y))
#define stb__windows(x,y) x
#define stb__windows(x,y) x
#else
#else
#define stb__fopen(x,y) fopen(x,y)
#define stb__fopen(x,y) fopen(x,y)
...
@@ -1244,7 +1244,7 @@ void stb_newell_normal(float *normal, int num_vert, float **vert, int normalize)
...
@@ -1244,7 +1244,7 @@ void stb_newell_normal(float *normal, int num_vert, float **vert, int normalize)
int
stb_box_face_vertex_axis_side
(
int
face_number
,
int
vertex_number
,
int
axis
)
int
stb_box_face_vertex_axis_side
(
int
face_number
,
int
vertex_number
,
int
axis
)
{
{
static
box_vertices
[
6
][
4
][
3
]
=
static
int
box_vertices
[
6
][
4
][
3
]
=
{
{
{
{
1
,
1
,
1
},
{
1
,
0
,
1
},
{
1
,
0
,
0
},
{
1
,
1
,
0
}
},
{
{
1
,
1
,
1
},
{
1
,
0
,
1
},
{
1
,
0
,
0
},
{
1
,
1
,
0
}
},
{
{
0
,
0
,
0
},
{
0
,
0
,
1
},
{
0
,
1
,
1
},
{
0
,
1
,
0
}
},
{
{
0
,
0
,
0
},
{
0
,
0
,
1
},
{
0
,
1
,
1
},
{
0
,
1
,
0
}
},
...
@@ -4910,7 +4910,7 @@ void stb_nptr_recache(void)
...
@@ -4910,7 +4910,7 @@ void stb_nptr_recache(void)
#ifdef _MSC_VER
#ifdef _MSC_VER
#define stb_rename(x,y) _wrename(
stb__from_utf8(x),
stb__from_utf8_alt(y))
#define stb_rename(x,y) _wrename(
(const wchar_t *)stb__from_utf8(x), (const wchar_t *)
stb__from_utf8_alt(y))
#define stb_mktemp _mktemp
#define stb_mktemp _mktemp
#else
#else
#define stb_mktemp mktemp
#define stb_mktemp mktemp
...
@@ -5049,7 +5049,7 @@ int stb_fexists(char *filename)
...
@@ -5049,7 +5049,7 @@ int stb_fexists(char *filename)
{
{
struct
stb__stat
buf
;
struct
stb__stat
buf
;
return
stb__windows
(
return
stb__windows
(
_wstat
(
stb__from_utf8
(
filename
),
&
buf
),
_wstat
(
(
const
wchar_t
*
)
stb__from_utf8
(
filename
),
&
buf
),
stat
(
filename
,
&
buf
)
stat
(
filename
,
&
buf
)
)
==
0
;
)
==
0
;
}
}
...
@@ -5058,7 +5058,7 @@ time_t stb_ftimestamp(char *filename)
...
@@ -5058,7 +5058,7 @@ time_t stb_ftimestamp(char *filename)
{
{
struct
stb__stat
buf
;
struct
stb__stat
buf
;
if
(
stb__windows
(
if
(
stb__windows
(
_wstat
(
stb__from_utf8
(
filename
),
&
buf
),
_wstat
(
(
const
wchar_t
*
)
stb__from_utf8
(
filename
),
&
buf
),
stat
(
filename
,
&
buf
)
stat
(
filename
,
&
buf
)
)
==
0
)
)
==
0
)
{
{
...
@@ -5837,7 +5837,7 @@ static char **readdir_raw(char *dir, int return_subdirs, char *mask)
...
@@ -5837,7 +5837,7 @@ static char **readdir_raw(char *dir, int return_subdirs, char *mask)
#ifdef _MSC_VER
#ifdef _MSC_VER
strcpy
(
buffer
+
n
,
"*.*"
);
strcpy
(
buffer
+
n
,
"*.*"
);
ws
=
stb__from_utf8
(
buffer
);
ws
=
stb__from_utf8
(
buffer
);
z
=
_wfindfirst
(
ws
,
&
data
);
z
=
_wfindfirst
(
(
const
wchar_t
*
)
ws
,
&
data
);
#else
#else
z
=
opendir
(
dir
);
z
=
opendir
(
dir
);
#endif
#endif
...
@@ -5855,7 +5855,7 @@ static char **readdir_raw(char *dir, int return_subdirs, char *mask)
...
@@ -5855,7 +5855,7 @@ static char **readdir_raw(char *dir, int return_subdirs, char *mask)
do
{
do
{
int
is_subdir
;
int
is_subdir
;
#ifdef _MSC_VER
#ifdef _MSC_VER
char
*
name
=
stb__to_utf8
(
data
.
name
);
char
*
name
=
stb__to_utf8
(
(
stb__wchar
*
)
data
.
name
);
if
(
name
==
NULL
)
{
if
(
name
==
NULL
)
{
fprintf
(
stderr
,
"%s to convert '%S' to %s!
\n
"
,
"Unable"
,
data
.
name
,
"utf8"
);
fprintf
(
stderr
,
"%s to convert '%S' to %s!
\n
"
,
"Unable"
,
data
.
name
,
"utf8"
);
continue
;
continue
;
...
@@ -6804,9 +6804,9 @@ static void stb__dirtree_scandir(char *path, time_t last_time, stb_dirtree *acti
...
@@ -6804,9 +6804,9 @@ static void stb__dirtree_scandir(char *path, time_t last_time, stb_dirtree *acti
has_slash
=
(
path
[
0
]
&&
path
[
strlen
(
path
)
-
1
]
==
'/'
);
has_slash
=
(
path
[
0
]
&&
path
[
strlen
(
path
)
-
1
]
==
'/'
);
if
(
has_slash
)
if
(
has_slash
)
swprintf
(
full_path
,
L"%s*"
,
stb__from_utf8
(
path
));
swprintf
(
(
wchar_t
*
)
full_path
,
L"%s*"
,
stb__from_utf8
(
path
));
else
else
swprintf
(
full_path
,
L"%s/*"
,
stb__from_utf8
(
path
));
swprintf
(
(
wchar_t
*
)
full_path
,
L"%s/*"
,
stb__from_utf8
(
path
));
// it's possible this directory is already present: that means it was in the
// it's possible this directory is already present: that means it was in the
// cache, but its parent wasn't... in that case, we're done with it
// cache, but its parent wasn't... in that case, we're done with it
...
@@ -6818,13 +6818,13 @@ static void stb__dirtree_scandir(char *path, time_t last_time, stb_dirtree *acti
...
@@ -6818,13 +6818,13 @@ static void stb__dirtree_scandir(char *path, time_t last_time, stb_dirtree *acti
stb__dirtree_add_dir
(
path
,
last_time
,
active
);
stb__dirtree_add_dir
(
path
,
last_time
,
active
);
n
=
stb_arr_lastn
(
active
->
dirs
);
n
=
stb_arr_lastn
(
active
->
dirs
);
if
(
(
hFile
=
_wfindfirst
(
full_path
,
&
c_file
))
!=
-
1L
)
{
if
(
(
hFile
=
_wfindfirst
(
(
const
wchar_t
*
)
full_path
,
&
c_file
))
!=
-
1L
)
{
do
{
do
{
if
(
c_file
.
attrib
&
_A_SUBDIR
)
{
if
(
c_file
.
attrib
&
_A_SUBDIR
)
{
// ignore subdirectories starting with '.', e.g. "." and ".."
// ignore subdirectories starting with '.', e.g. "." and ".."
if
(
c_file
.
name
[
0
]
!=
'.'
)
{
if
(
c_file
.
name
[
0
]
!=
'.'
)
{
char
*
new_path
=
(
char
*
)
full_path
;
char
*
new_path
=
(
char
*
)
full_path
;
char
*
temp
=
stb__to_utf8
(
c_file
.
name
);
char
*
temp
=
stb__to_utf8
(
(
stb__wchar
*
)
c_file
.
name
);
if
(
has_slash
)
if
(
has_slash
)
sprintf
(
new_path
,
"%s%s"
,
path
,
temp
);
sprintf
(
new_path
,
"%s%s"
,
path
,
temp
);
else
else
...
@@ -6832,7 +6832,7 @@ static void stb__dirtree_scandir(char *path, time_t last_time, stb_dirtree *acti
...
@@ -6832,7 +6832,7 @@ static void stb__dirtree_scandir(char *path, time_t last_time, stb_dirtree *acti
stb__dirtree_scandir
(
new_path
,
c_file
.
time_write
,
active
);
stb__dirtree_scandir
(
new_path
,
c_file
.
time_write
,
active
);
}
}
}
else
{
}
else
{
char
*
temp
=
stb__to_utf8
(
c_file
.
name
);
char
*
temp
=
stb__to_utf8
(
(
stb__wchar
*
)
c_file
.
name
);
stb__dirtree_add_file
(
temp
,
n
,
c_file
.
size
,
c_file
.
time_write
,
active
);
stb__dirtree_add_file
(
temp
,
n
,
c_file
.
size
,
c_file
.
time_write
,
active
);
}
}
}
while
(
_wfindnext
(
hFile
,
&
c_file
)
==
0
);
}
while
(
_wfindnext
(
hFile
,
&
c_file
)
==
0
);
...
@@ -11049,7 +11049,7 @@ stb_arith_symstate *stb_arith_state_create(int num_sym)
...
@@ -11049,7 +11049,7 @@ stb_arith_symstate *stb_arith_state_create(int num_sym)
return
s
;
return
s
;
}
}
static
stb_arith_state_rescale
(
stb_arith_symstate
*
s
)
static
void
stb_arith_state_rescale
(
stb_arith_symstate
*
s
)
{
{
if
(
s
->
pow2
<
POW2_LIMIT
)
{
if
(
s
->
pow2
<
POW2_LIMIT
)
{
int
pcf
,
cf
,
cf_next
,
next
,
i
;
int
pcf
,
cf
,
cf_next
,
next
,
i
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录