am e4030e0b: Merge "Fix several compiler warnings."

* commit 'e4030e0bfc427e755477bbea69afe60308a62d91':
  Fix several compiler warnings.
This commit is contained in:
Elliott Hughes 2012-09-26 16:04:51 -07:00 committed by Android Git Automerger
commit fd6ca57f24
3 changed files with 9 additions and 3 deletions

View File

@ -57,7 +57,7 @@ class ScopedSignalBlocker {
static FILE* __tmpfile_dir(const char* tmp_dir) { static FILE* __tmpfile_dir(const char* tmp_dir) {
char buf[PATH_MAX]; char buf[PATH_MAX];
int path_length = snprintf(buf, sizeof(buf), "%s/tmp.XXXXXXXXXX", tmp_dir); int path_length = snprintf(buf, sizeof(buf), "%s/tmp.XXXXXXXXXX", tmp_dir);
if (path_length >= sizeof(buf)) { if (path_length >= static_cast<int>(sizeof(buf))) {
return NULL; return NULL;
} }

View File

@ -17,6 +17,12 @@
#ifndef _BIONIC_NETBSD_EXTERN_H_included #ifndef _BIONIC_NETBSD_EXTERN_H_included
#define _BIONIC_NETBSD_EXTERN_H_included #define _BIONIC_NETBSD_EXTERN_H_included
// Placeholder. #include <sys/cdefs.h>
__BEGIN_DECLS
const char* __strsignal(int, char*, size_t);
__END_DECLS
#endif #endif

View File

@ -34,7 +34,7 @@ typedef enum {
TYPE_APP TYPE_APP
} uid_type_t; } uid_type_t;
static void check_getpwnam(const char* username, int uid, uid_type_t uid_type) { static void check_getpwnam(const char* username, uid_t uid, uid_type_t uid_type) {
errno = 0; errno = 0;
passwd* pwd = getpwuid(uid); passwd* pwd = getpwuid(uid);
ASSERT_TRUE(pwd != NULL); ASSERT_TRUE(pwd != NULL);