summaryrefslogtreecommitdiffstats
path: root/libdimension/profile.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-02-28 16:28:21 -0500
committerTavian Barnes <tavianator@gmail.com>2011-03-08 21:43:18 -0500
commita2bf45329a172d2c53594c64d27f1c15ac26796a (patch)
tree93c6c3e7404e4abc605c410f978aefa3dd3231fa /libdimension/profile.c
parentf69c955c28b7e5c2eaf4af036cb88480a8e433f3 (diff)
downloaddimension-a2bf45329a172d2c53594c64d27f1c15ac26796a.tar.xz
New dmnsn_warning() API, remove different severities.
Diffstat (limited to 'libdimension/profile.c')
-rw-r--r--libdimension/profile.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libdimension/profile.c b/libdimension/profile.c
index dd680db..cb94cc4 100644
--- a/libdimension/profile.c
+++ b/libdimension/profile.c
@@ -66,11 +66,11 @@ dmnsn_delete_thread_profile(void *ptr)
dmnsn_dictionary *thread_profile = ptr;
if (pthread_mutex_lock(&dmnsn_profile_mutex) != 0) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't lock mutex.");
+ dmnsn_error("Couldn't lock mutex.");
}
dmnsn_dictionary_apply(thread_profile, &dmnsn_profile_globalize);
if (pthread_mutex_unlock(&dmnsn_profile_mutex) != 0) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't unlock mutex.");
+ dmnsn_error("Couldn't unlock mutex.");
}
dmnsn_delete_dictionary(thread_profile);
@@ -84,15 +84,15 @@ dmnsn_initialize_thread_profile(void)
&dmnsn_delete_thread_profile)
!= 0)
{
- dmnsn_error(DMNSN_SEVERITY_HIGH, "pthread_key_create() failed.");
+ dmnsn_error("pthread_key_create() failed.");
}
if (pthread_mutex_lock(&dmnsn_profile_mutex) != 0) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't lock mutex.");
+ dmnsn_error("Couldn't lock mutex.");
}
dmnsn_profile = dmnsn_new_dictionary(sizeof(dmnsn_branch));
if (pthread_mutex_unlock(&dmnsn_profile_mutex) != 0) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't unlock mutex.");
+ dmnsn_error("Couldn't unlock mutex.");
}
}
@@ -104,7 +104,7 @@ dmnsn_get_thread_profile(void)
&dmnsn_initialize_thread_profile)
!= 0)
{
- dmnsn_error(DMNSN_SEVERITY_HIGH, "pthread_once() failed.");
+ dmnsn_error("pthread_once() failed.");
}
return pthread_getspecific(dmnsn_thread_profile);
@@ -115,7 +115,7 @@ static void
dmnsn_set_thread_profile(dmnsn_dictionary *thread_profile)
{
if (pthread_setspecific(dmnsn_thread_profile, thread_profile) != 0) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "pthread_setspecific() failed.");
+ dmnsn_error("pthread_setspecific() failed.");
}
}
@@ -125,12 +125,12 @@ dmnsn_expect(bool result, bool expected, const char *func, const char *file,
{
int size = snprintf(NULL, 0, "%s:%s:%u", file, func, line) + 1;
if (size < 1) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "sprintf() failed.");
+ dmnsn_error("sprintf() failed.");
}
char key[size];
if (snprintf(key, size, "%s:%s:%u", file, func, line) < 0) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "sprintf() failed.");
+ dmnsn_error("sprintf() failed.");
}
dmnsn_dictionary *thread_profile = dmnsn_get_thread_profile();
@@ -181,12 +181,12 @@ dmnsn_print_bad_predictions(void)
}
if (pthread_mutex_lock(&dmnsn_profile_mutex) != 0) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't lock mutex.");
+ dmnsn_error("Couldn't lock mutex.");
}
dmnsn_dictionary_apply(dmnsn_profile, &dmnsn_print_bad_prediction);
dmnsn_delete_dictionary(dmnsn_profile);
dmnsn_profile = NULL;
if (pthread_mutex_unlock(&dmnsn_profile_mutex) != 0) {
- dmnsn_error(DMNSN_SEVERITY_HIGH, "Couldn't unlock mutex.");
+ dmnsn_error("Couldn't unlock mutex.");
}
}