include $(CLEAR_VARS)
LOCAL_SRC_FILES := boot_control_copy.c bootinfo.c
-LOCAL_CFLAGS := -Wall -Wno-missing-field-initializers
+LOCAL_CFLAGS := -Wall -Wno-missing-field-initializers -Wno-unused-parameter
LOCAL_C_INCLUDES := system/core/mkbootimg bootable/recovery
LOCAL_SHARED_LIBRARIES := libcutils
LOCAL_STATIC_LIBRARIES := libfs_mgr
void boot_info_reset(BrilloBootInfo* info)
{
- size_t n;
memset(info, '\0', sizeof(BrilloBootInfo));
info->magic[0] = 'B';
info->magic[1] = 'C';
/* These match the Linux definitions of these flags.
L_xx is defined to avoid conflicting with the win32 versions.
*/
+#undef S_IRWXU
+#undef S_IRGRP
+#undef S_IWGRP
+#undef S_IXGRP
+#undef S_IRWXG
+#undef S_IROTH
+#undef S_IWOTH
+#undef S_IXOTH
+#undef S_IRWXO
+#undef S_ISUID
+#undef S_ISGID
+#undef S_ISVTX
+
#define L_S_IRUSR 00400
#define L_S_IWUSR 00200
#define L_S_IXUSR 00100
libsparse_host \
libz
LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_HOST_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := f2fs_ioutils.c
LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
+LOCAL_CFLAGS := -Wno-unused-parameter
LOCAL_STATIC_LIBRARIES := \
libselinux \
libsparse_host \
LOCAL_MODULE := libf2fs_utils_static
LOCAL_SRC_FILES := f2fs_utils.c
LOCAL_C_INCLUDES := external/f2fs-tools/include external/f2fs-tools/mkfs
+LOCAL_CFLAGS := -Wno-unused-parameter
LOCAL_STATIC_LIBRARIES := \
libsparse_static
include $(BUILD_STATIC_LIBRARY)
#define _LARGEFILE64_SOURCE
+#include <assert.h>
#include <asm/types.h>
+#include <dlfcn.h>
#include <errno.h>
+#include <fcntl.h>
#include <linux/fs.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <fcntl.h>
-#include <dlfcn.h>
-
-#include <assert.h>
+#include <unistd.h>
#include <f2fs_fs.h>
#include <f2fs_format_utils.h>
{
if (lseek64(config.fd, (off64_t)offset, SEEK_SET) < 0)
return -1;
- if (write(config.fd, buf, len) != len)
+ ssize_t written = write(config.fd, buf, len);
+ if (written == -1)
+ return -1;
+ if ((size_t)written != len)
return -1;
return 0;
}
#include <fcntl.h>
#include <libgen.h>
#include <stdio.h>
-#include <unistd.h>
#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#if defined(__linux__)
#include <linux/fs.h>
#include <sys/disk.h>
#endif
+#include "make_f2fs.h"
+
#ifndef USE_MINGW /* O_BINARY is windows-specific flag */
#define O_BINARY 0
#endif
static int read_pages(struct ksm_pages *kp, pm_map_t **maps, size_t num_maps, uint8_t pr_flags) {
size_t i, j, k;
- size_t len;
uint64_t *pagemap;
size_t map_len;
uint64_t flags;
fprintf(stderr, "warning: could not lseek to 0x%08lx\n", vaddr);
continue;
}
- len = read(fd, data, pm_kernel_pagesize(ker));
+ ssize_t len = read(fd, data, pm_kernel_pagesize(ker));
if (len != pm_kernel_pagesize(ker)) {
fprintf(stderr, "warning: could not read page at 0x%08lx\n", vaddr);
continue;
LOCAL_MODULE_TAGS := debug
+LOCAL_CFLAGS := -Wno-unused-parameter
+
include $(BUILD_EXECUTABLE)
LOCAL_MODULE_TAGS := debug
LOCAL_SRC_FILES := $(pagemap_src_files)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
+LOCAL_CFLAGS := -Wno-unused-parameter
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
include $(BUILD_SHARED_LIBRARY)
for (std::vector<const process_info_t *>::const_iterator it = list_.begin();
it != list_.end(); ++it) {
ALOGI(" Name: %s", (*it)->name.c_str());
- ALOGI(" Max running processes: %d", (*it)->max_num_pids);
+ ALOGI(" Max running processes: %zu", (*it)->max_num_pids);
if ((*it)->pids.size() > 0) {
ALOGI(" Currently running pids:");
for (std::vector<int>::const_iterator pid_it = (*it)->pids.begin();
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := debug
LOCAL_MODULE := sane_schedstat
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_EXECUTABLE)
* set_sort_func - return the slab_sort_func that matches the given key.
* On unrecognizable key, the call returns NULL.
*/
-static void * set_sort_func(char key)
+static sort_t set_sort_func(char key)
{
switch (tolower(key)) {
case 'a':
include $(CLEAR_VARS)
LOCAL_MODULE := sound
LOCAL_SRC_FILES := playwav.c
-LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_EXECUTABLE)
static unsigned int mixers;
static unsigned int timers;
-int getPcmNodes(void)
+unsigned int getPcmNodes(void)
{
DIR *d;
struct dirent *de;
TEST(pcmtest, CheckAudioDir) {
pcms = getPcmNodes();
- ASSERT_GT(pcms, 0);
+ ASSERT_GT(pcms, 0U);
}
TEST(pcmtest, GetSoundDevs) {
}
TEST(pcmtest, CheckPcmSanity0) {
- ASSERT_NE(0, pcms);
+ ASSERT_NE(0U, pcms);
}
TEST(pcmtest, CheckPcmSanity1) {
- EXPECT_NE(1, pcms % 2);
+ EXPECT_NE(1U, pcms % 2);
}
TEST(pcmtests, CheckMixerSanity) {
- ASSERT_NE(0, mixers);
+ ASSERT_NE(0U, mixers);
ASSERT_EQ(mixers, cards);
}
TEST(pcmtest, CheckTimesSanity0) {
- ASSERT_NE(0, timers);
+ ASSERT_NE(0U, timers);
}
TEST(pcmtest, CheckTimesSanity1) {
- EXPECT_EQ(1, timers);
+ EXPECT_EQ(1U, timers);
}
TEST(pcmtest, CheckPcmDevices) {
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := eng
LOCAL_SRC_FILES := cpueater.c
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= get_dm_versions.c
LOCAL_MODULE:= get_dm_versions
LOCAL_MODULE_TAGS := optional
-LOCAL_CFLAGS :=
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_EXECUTABLE)
LOCAL_MODULE:= test-fb-refresh
-LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := fb_test.c
LOCAL_MODULE = test-fb-simple
-LOCAL_MODULE_TAGS := optional
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_STATIC_LIBRARIES := libc
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_EXECUTABLE)
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#define FSTAB_PREFIX "/fstab."
#define SB_OFFSET 1024
-#define UMOUNT_BIN "/system/bin/umount"
-#define VDC_BIN "/system/bin/vdc"
+static char UMOUNT_BIN[] = "/system/bin/umount";
+static char VDC_BIN[] = "/system/bin/vdc";
enum Fs_Type { FS_UNKNOWN, FS_EXT4, FS_F2FS };
}
bool unmountCache() {
+ char cache_str[] = "/cache";
char *umount_argv[] = {
UMOUNT_BIN,
- "/cache"
+ cache_str,
};
int status;
return android_fork_execvp_ext(ARRAY_SIZE(umount_argv), umount_argv,
}
bool mountAll() {
+ char storage_str[] = "storage";
+ char mountall_str[] = "mountall";
char *mountall_argv[] = {
VDC_BIN,
- "storage",
- "mountall"
+ storage_str,
+ mountall_str,
};
int status;
return android_fork_execvp_ext(ARRAY_SIZE(mountall_argv), mountall_argv,
int fds[4] = {-1, -1, -1, -1};
char tmpnames[4][17] = { "thrashing1XXXXXX", "thrashing2XXXXXX", "thrashing3XXXXXX", "thrashing4XXXXXX" };
volatile char *bufs[4] = {0};
- unsigned i, j;
long long k;
int ret = -1;
struct timeval begin_time, end_time, elapsed_time, total_time;
filesize = num_pages * pagesize / (ARRAY_SIZE(fds) - 1);
- for (i = 0; i < ARRAY_SIZE(fds); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(fds); i++) {
fds[i] = create_tmp_file(tmpnames[i], filesize);
if (fds[i] < 0) {
goto err_fd;
}
}
- for (i = 0; i < ARRAY_SIZE(fds); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(fds); i++) {
bufs[i] = mmap(NULL, filesize, PROT_READ, MAP_PRIVATE, fds[i], 0);
if (bufs[i] == ((void *)-1)) {
fprintf(stderr, "Failed to mmap file: %s\n", strerror(errno));
}
}
- for (i = 0; i < test_runs; i++) {
- for (j = 0; j < ARRAY_SIZE(fds); j++) {
+ for (int i = 0; i < test_runs; i++) {
+ for (size_t j = 0; j < ARRAY_SIZE(fds); j++) {
gettimeofday(&begin_time, NULL);
//Unfortunately when under memory pressure, fadvise and madvise stop working...
//Read backwards to prevent mmap prefetching
ret = 0;
err:
- for (i = 0; i < ARRAY_SIZE(bufs) && bufs[i] != NULL; i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(bufs) && bufs[i] != NULL; i++) {
munmap((void *)bufs[i], filesize);
}
err_fd:
- for (i = 0; i < ARRAY_SIZE(fds) && fds[i] >= 0; i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(fds) && fds[i] >= 0; i++) {
close(fds[i]);
}
return ret;
schedtest.c
LOCAL_MODULE := schedtest
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_EXECUTABLE)
LOCAL_SHARED_LIBRARIES += libcutils
LOCAL_MODULE:= uevents
-LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := -Wno-unused-parameter
include $(BUILD_EXECUTABLE)