misc minor edits.

- pass string size to BLI_timestr() to avoid possible buffer overrun.
- quiet warning for mingw.
- include guards for windows utf conversion funcs.
- fix for mistage in edge-angle-selection check.
- some style cleanup.
This commit is contained in:
Campbell Barton
2013-03-29 06:25:22 +00:00
parent ab41583bc2
commit 1777a69818
28 changed files with 78 additions and 70 deletions

View File

@@ -34,7 +34,7 @@
#include <wchar.h>
FILE * ufopen(const char * filename, const char * mode)
FILE *ufopen(const char *filename, const char *mode)
{
FILE *f = NULL;
UTF16_ENCODE(filename);
@@ -120,7 +120,7 @@ int umkdir(const char *pathname)
return r ? 0 : -1;
}
char * u_alloc_getenv(const char *varname)
char *u_alloc_getenv(const char *varname)
{
char * r = 0;
wchar_t * str;

View File

@@ -23,21 +23,26 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __UTF_WINFUNC_H__
#define __UTF_WINFUNC_H__
#ifndef WIN32
# error "This file can only compile on windows"
#endif
#include <stdio.h>
FILE * ufopen(const char * filename, const char * mode);
FILE *ufopen(const char * filename, const char * mode);
int uopen(const char *filename, int oflag, int pmode);
int uaccess(const char *filename, int mode);
int urename(const char *oldname, const char *newname );
int urename(const char *oldname, const char *newname);
char * u_alloc_getenv(const char *varname);
char *u_alloc_getenv(const char *varname);
void u_free_getenv(char *val);
int uput_getenv(const char *varname, char * value, size_t buffsize);
int uput_getenv(const char *varname, char *value, size_t buffsize);
int uputenv(const char *name, const char *value);
int umkdir(const char *pathname);
#endif /* __UTF_WINFUNC_H__ */

View File

@@ -23,6 +23,9 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __UTFCONV_H__
#define __UTFCONV_H__
#include <wchar.h>
#include <stdio.h>
#include <stdlib.h>
@@ -98,3 +101,5 @@ wchar_t *alloc_utf16_from_8(const char *in8, size_t add);
#ifdef __cplusplus
}
#endif
#endif /* __UTFCONV_H__ */