From 1b53925b4c2e210972eb24882a5ab5b04effa9af Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 2 Feb 2017 10:13:24 +0900 Subject: [PATCH] evlog - fix "remove setting stack var to 0" that broke evlogs this fixes b38c610c7e60cbdcb45fd6d27450e39e3a9c9dd1 - recent commit by me. bad me! spank! --- src/lib/eina/eina_evlog.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/lib/eina/eina_evlog.c b/src/lib/eina/eina_evlog.c index 359badb..8c06857 100644 --- a/src/lib/eina/eina_evlog.c +++ b/src/lib/eina/eina_evlog.c @@ -128,35 +128,34 @@ EAPI void eina_evlog(const char *event, void *obj, double srctime, const char *detail) { Eina_Evlog_Item *item; - int size; char *strings; double now; + int size; unsigned short detail_offset, event_size; if (!_evlog_go) return; - - now = get_time(); - event_size = strlen(event) + 1; - size = sizeof(Eina_Evlog_Item) + event_size; + now = get_time(); + event_size = strlen(event) + 1; + size = sizeof(Eina_Evlog_Item) + event_size; + detail_offset = 0; if (detail) { detail_offset = size; size += strlen(detail) + 1; } - else detail_offset = 0; - size = sizeof(double) * ((size + sizeof(double) - 1) / sizeof(double)); - + size = sizeof(double) * ((size + sizeof(double) - 1) + / sizeof(double)); eina_spinlock_take(&_evlog_lock); - strings = push_buf(buf, size); - item = (Eina_Evlog_Item *)strings; - item->tim = now; - item->srctim = srctime; - item->thread = (unsigned long long)pthread_self(); - item->obj = (unsigned long long)obj; - item->event_offset = sizeof(Eina_Evlog_Item); - item->detail_offset = detail_offset; - item->event_next = size; - strcpy(strings + size, event); + strings = push_buf(buf, size); + item = (Eina_Evlog_Item *)strings; + item->tim = now; + item->srctim = srctime; + item->thread = (unsigned long long)pthread_self(); + item->obj = (unsigned long long)obj; + item->event_offset = sizeof(Eina_Evlog_Item); + item->detail_offset = detail_offset; + item->event_next = size; + strcpy(strings + sizeof(Eina_Evlog_Item), event); if (detail_offset > 0) strcpy(strings + detail_offset, detail); eina_spinlock_release(&_evlog_lock); } -- 2.7.4