PACK_COMMON_BEGIN(MSG_PROBE_CUSTOM,
API_ID__chart_timerThread,
"", 0);
- PACK_COMMON_END(0, 0, 2);
+ PACK_COMMON_END('p', 0, 0, 2);
PACK_CUSTOM(cur->series_handle, 0, "", 0, value);
FLUSH_LOCAL_BUF();
return ERR_WRONG_PARAMETER;
}
- if(*timerfd != -1 || *thread_handle != -1)
+ /**
+ * FIXME: Type of pthread_t is undefined.
+ * Comparing it with -1 is *very* bad
+ */
+ if (*timerfd != -1 || *thread_handle != (pthread_t) -1)
return 0; // already thread exist
*timerfd = timerfd_create(CLOCK_REALTIME, 0);
- if(*timerfd == -1)
+ if (*timerfd == -1)
return errno;
- if(timerfd_settime(*timerfd, 0, &timevalue, NULL) == -1)
+ if (timerfd_settime(*timerfd, 0, &timevalue, NULL) == -1)
return errno;
- if(pthread_create(thread_handle, NULL, _chart_timerThread, pman) < 0)
+ if (pthread_create(thread_handle, NULL, _chart_timerThread, pman) < 0)
return ERR_THREAD_CREATE_FAIL;
return 0;
// constructor and destructor functions
// =====================================================================
-void memory_initialize_hook(void);
-void (*__malloc_initialize_hook) (void) = memory_initialize_hook;
-
void __attribute__((constructor)) _init_lib()
{
probeBlockStart();
probeBlockStart();
remove_all_callback_list();
- if(chm.interval_10ms.timerfd != -1)
+ if (chm.interval_10ms.timerfd != -1)
close(chm.interval_10ms.timerfd);
- if(chm.interval_100ms.timerfd != -1)
+ if (chm.interval_100ms.timerfd != -1)
close(chm.interval_100ms.timerfd);
- if(chm.interval_1s.timerfd != -1)
+ if (chm.interval_1s.timerfd != -1)
close(chm.interval_1s.timerfd);
-
- if(chm.interval_10ms.thread_handle != -1)
- {
+ /*! Bad. Ugly. Unportable */
+ if (chm.interval_10ms.thread_handle != (pthread_t) -1)
pthread_join(chm.interval_10ms.thread_handle, NULL);
- }
- if(chm.interval_100ms.thread_handle != -1)
- {
+ if (chm.interval_100ms.thread_handle != (pthread_t) -1)
pthread_join(chm.interval_100ms.thread_handle, NULL);
- }
- if(chm.interval_1s.thread_handle != -1)
- {
+ if (chm.interval_1s.thread_handle != (pthread_t) -1)
pthread_join(chm.interval_1s.thread_handle, NULL);
- }
probeBlockEnd();
}
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_CUSTOM,
API_ID_da_mark,
- "dp", color, mark_text);
- PACK_COMMON_END(0, 0, 2);
+ "dp", color, voidp_to_uint64(mark_text));
+ PACK_COMMON_END('v', 0, 0, 2);
PACK_CUSTOM(0, 0, mark_text, color, 0.0f);
FLUSH_LOCAL_BUF();
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_CUSTOM,
API_ID_da_create_chart,
- "p", chart_name);
- PACK_COMMON_END(ret, 0, 2);
+ "p", voidp_to_uint64(chart_name));
+ PACK_COMMON_END('d', ret, 0, 2);
PACK_CUSTOM(0, 0, chart_name, 0, 0.0f);
FLUSH_LOCAL_BUF();
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_CUSTOM,
API_ID_da_create_series,
- "dpdd", charthandle, seriesname, type, color);
- PACK_COMMON_END(ret, 0, 2);
+ "dpdd", charthandle, voidp_to_uint64(seriesname),
+ type, color);
+ PACK_COMMON_END('d', ret, 0, 2);
PACK_CUSTOM(charthandle, type, seriesname, color, 0.0f);
FLUSH_LOCAL_BUF();
PREPARE_LOCAL_BUF();
PACK_COMMON_BEGIN(MSG_PROBE_CUSTOM,
API_ID_da_log,
- "dw", series_handle, uservalue);
- PACK_COMMON_END(0, 0, 2);
+ "df", series_handle, uservalue);
+ PACK_COMMON_END('v', 0, 0, 2);
PACK_CUSTOM(series_handle, 0, "", 0, uservalue);
FLUSH_LOCAL_BUF();