Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9318e4d9 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Gerrit Code Review
Browse files

Merge "liblog: set -Werror"

parents d150618d a04464ad
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ endif
# ========================================================
LOCAL_MODULE := liblog
LOCAL_SRC_FILES := $(liblog_host_sources)
LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1
LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -Werror
include $(BUILD_HOST_STATIC_LIBRARY)

include $(CLEAR_VARS)
@@ -74,7 +74,7 @@ include $(BUILD_HOST_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := lib64log
LOCAL_SRC_FILES := $(liblog_host_sources)
LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -m64
LOCAL_CFLAGS := -DFAKE_LOG_DEVICE=1 -m64 -Werror
include $(BUILD_HOST_STATIC_LIBRARY)

# Shared and static library for target
@@ -82,13 +82,13 @@ include $(BUILD_HOST_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := liblog
LOCAL_SRC_FILES := $(liblog_target_sources)
LOCAL_CFLAGS := $(liblog_cflags)
LOCAL_CFLAGS := -Werror
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := liblog
LOCAL_WHOLE_STATIC_LIBRARIES := liblog
LOCAL_CFLAGS := $(liblog_cflags)
LOCAL_CFLAGS := -Werror
include $(BUILD_SHARED_LIBRARY)

include $(call first-makefiles-under,$(LOCAL_PATH))
+6 −22
Original line number Diff line number Diff line
@@ -13,15 +13,16 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <log/event_tag_map.h>
#include <log/log.h>

#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
#include <assert.h>

#include <log/event_tag_map.h>
#include <log/log.h>

#define OUT_TAG "EventTagMap"

@@ -52,7 +53,6 @@ static int countMapLines(const EventTagMap* map);
static int parseMapLines(EventTagMap* map);
static int scanTagLine(char** pData, EventTag* tag, int lineNum);
static int sortTags(EventTagMap* map);
static void dumpTags(const EventTagMap* map);


/*
@@ -185,8 +185,6 @@ static inline int isCharDigit(char c)
 */
static int processFile(EventTagMap* map)
{
    EventTag* tagArray = NULL;

    /* get a tag count */
    map->numTags = countMapLines(map);
    if (map->numTags < 0)
@@ -422,17 +420,3 @@ static int sortTags(EventTagMap* map)

    return 0;
}

/*
 * Dump the tag array for debugging.
 */
static void dumpTags(const EventTagMap* map)
{
    int i;

    for (i = 0; i < map->numTags; i++) {
        const EventTag* tag = &map->tagArray[i];
        printf("  %3d: %6d '%s'\n", i, tag->tagIndex, tag->tagStr);
    }
}
+9 −5
Original line number Diff line number Diff line
@@ -21,18 +21,22 @@
 */
#include "fake_log_device.h"

#include <log/logd.h>

#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>

#include <log/logd.h>

#ifdef HAVE_PTHREADS
#include <pthread.h>
#endif

#ifndef __unused
#define __unused __attribute__((__unused__))
#endif

#define kMaxTagLen  16      /* from the long-dead utils/Log.cpp */

#define kTagSetSize 16      /* arbitrary */
@@ -613,7 +617,7 @@ static int logClose(int fd)
/*
 * Open a log output device and return a fake fd.
 */
static int logOpen(const char* pathName, int flags)
static int logOpen(const char* pathName, int flags __unused)
{
    LogState *logState;
    int fd = -1;
+9 −10
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#define NOMINMAX /* for windows to suppress definition of min in stdlib.h */
#include <stdlib.h>
#include <string.h>
#include <sys/cdefs.h>
#include <unistd.h>

#include <cutils/list.h>
@@ -34,7 +35,9 @@
#define min(x,y) ((y) ^ (((x) ^ (y)) & -((x) < (y))))

#define WEAK __attribute__((weak))
#define UNUSED __attribute__((unused))
#ifndef __unused
#define __unused __attribute__((unused))
#endif

/* Private copy of ../libcutils/socket_local_client.c prevent library loops */

@@ -142,11 +145,10 @@ error:
 * Used by AndroidSocketImpl
 */
int WEAK socket_local_client_connect(int fd, const char *name, int namespaceId,
                                     int type UNUSED)
                                     int type __unused)
{
    struct sockaddr_un addr;
    socklen_t alen;
    size_t namelen;
    int err;

    err = socket_make_sockaddr_un(name, namespaceId, &addr, &alen);
@@ -409,7 +411,7 @@ long android_logger_get_log_readable_size(struct logger *logger)
/*
 * returns the logger version
 */
int android_logger_get_log_version(struct logger *logger UNUSED)
int android_logger_get_log_version(struct logger *logger __unused)
{
    return 3;
}
@@ -420,7 +422,6 @@ int android_logger_get_log_version(struct logger *logger UNUSED)
ssize_t android_logger_get_statistics(struct logger_list *logger_list,
                                      char *buf, size_t len)
{
    struct listnode *node;
    struct logger *logger;
    char *cp = buf;
    size_t remaining = len;
@@ -440,13 +441,13 @@ ssize_t android_logger_get_statistics(struct logger_list *logger_list,
    return send_log_msg(NULL, NULL, buf, len);
}

ssize_t android_logger_get_prune_list(struct logger_list *logger_list UNUSED,
ssize_t android_logger_get_prune_list(struct logger_list *logger_list __unused,
                                      char *buf, size_t len)
{
    return send_log_msg(NULL, "getPruneList", buf, len);
}

int android_logger_set_prune_list(struct logger_list *logger_list UNUSED,
int android_logger_set_prune_list(struct logger_list *logger_list __unused,
                                  char *buf, size_t len)
{
    const char cmd[] = "setPruneList ";
@@ -512,9 +513,7 @@ struct logger_list *android_logger_list_alloc_time(int mode,
struct logger *android_logger_open(struct logger_list *logger_list,
                                   log_id_t id)
{
    struct listnode *node;
    struct logger *logger;
    char *n;

    if (!logger_list || (id >= LOG_ID_MAX)) {
        goto err;
@@ -561,7 +560,7 @@ struct logger_list *android_logger_list_open(log_id_t id,
    return logger_list;
}

static void caught_signal(int signum UNUSED)
static void caught_signal(int signum __unused)
{
}

+12 −9
Original line number Diff line number Diff line
@@ -21,12 +21,13 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/cdefs.h>
#include <sys/ioctl.h>

#include <cutils/list.h>
#include <log/log.h>
#include <log/logger.h>

#include <sys/ioctl.h>

#define __LOGGERIO     0xAE

#define LOGGER_GET_LOG_BUF_SIZE    _IO(__LOGGERIO, 1) /* size of log */
@@ -51,7 +52,9 @@ typedef char bool;
         logger != node_to_item(&(logger_list)->node, struct logger, node); \
         logger = node_to_item((logger)->node.next, struct logger, node))

#define UNUSED __attribute__((unused))
#ifndef __unused
#define __unused __attribute__((unused))
#endif

/* In the future, we would like to make this list extensible */
static const char *LOG_NAME[LOG_ID_MAX] = {
@@ -233,8 +236,8 @@ long android_logger_get_log_size(struct logger *logger)
    return logger_ioctl(logger, LOGGER_GET_LOG_BUF_SIZE, O_RDWR);
}

int android_logger_set_log_size(struct logger *logger UNUSED,
                                unsigned long size UNUSED)
int android_logger_set_log_size(struct logger *logger __unused,
                                unsigned long size __unused)
{
    return -ENOTSUP;
}
@@ -262,21 +265,21 @@ int android_logger_get_log_version(struct logger *logger)
 */
static const char unsupported[] = "18\nNot Supported\n\f";

ssize_t android_logger_get_statistics(struct logger_list *logger_list UNUSED,
ssize_t android_logger_get_statistics(struct logger_list *logger_list __unused,
                                      char *buf, size_t len)
{
    strncpy(buf, unsupported, len);
    return -ENOTSUP;
}

ssize_t android_logger_get_prune_list(struct logger_list *logger_list UNUSED,
ssize_t android_logger_get_prune_list(struct logger_list *logger_list __unused,
                                      char *buf, size_t len)
{
    strncpy(buf, unsupported, len);
    return -ENOTSUP;
}

int android_logger_set_prune_list(struct logger_list *logger_list UNUSED,
int android_logger_set_prune_list(struct logger_list *logger_list __unused,
                                  char *buf, size_t len)
{
    static const char unsupported_error[] = "Unsupported";
@@ -302,7 +305,7 @@ struct logger_list *android_logger_list_alloc(int mode,
}

struct logger_list *android_logger_list_alloc_time(int mode,
                                                   log_time start UNUSED,
                                                   log_time start __unused,
                                                   pid_t pid)
{
    return android_logger_list_alloc(mode, 0, pid);
Loading