changeset 838:f534480e2a44 v4.2-rc1

utilities & tests: no longer need an explicit libjeffpc initialization Utilities and tests don't need the explicit initialization. There were two reasons blahg code did it: (1) memory allocation purposes - making sure that the libjeffpc slab allocator was initialized (2) setting up a log function - to direct errors to syslog Recently, libjeffpc changed so that it uses shared object constructors, therefore #1 is no longer a requirement. And as far as #2 is concerned, the utilities and tests don't want to spam syslog anyway. Previously, they accomplished this by setting BLAHG_DISABLE_SYSLOG=1. Since not logging is the default for libjeffpc, we can accomplish the same thing by not giving it the custom ops vector and relying on the defaults. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Thu, 13 Apr 2017 11:18:44 -0400
parents 478fd50564ba
children e4bd8c2b07e0
files CMakeLists.txt lisplint.c test_fmt3.c
diffstat 3 files changed, 3 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Thu Apr 13 00:49:54 2017 -0400
+++ b/CMakeLists.txt	Thu Apr 13 11:18:44 2017 -0400
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011-2016 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+# Copyright (c) 2011-2017 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -152,7 +152,6 @@
 
 add_executable(lisplint
 	lisplint.c
-	error.c
 	mangle.c
 	utils.c
 
@@ -172,7 +171,6 @@
 	utils.c
 	nvl.c
 	vars_dump.c
-	error.c
 )
 
 target_link_libraries(nvdump
@@ -192,7 +190,7 @@
 	config.c
 	math.c
 	listing.c
-	mangle.c utils.c error.c
+	mangle.c utils.c
 	nvl.c
 	nvl_convert.c
 )
@@ -208,7 +206,6 @@
 
 add_executable(test_qstring
 	test_qstring.c
-	error.c
 	utils.c
 	vars.c vars_dump.c nvl.c
 	qstring.c
--- a/lisplint.c	Thu Apr 13 00:49:54 2017 -0400
+++ b/lisplint.c	Thu Apr 13 11:18:44 2017 -0400
@@ -30,7 +30,6 @@
 
 #include "utils.h"
 #include "config.h"
-#include "debug.h"
 
 static char *prog;
 
@@ -193,9 +192,6 @@
 	result = 0;
 
 	ASSERT0(putenv("UMEM_DEBUG=default,verbose"));
-	ASSERT0(putenv("BLAHG_DISABLE_SYSLOG=1"));
-
-	jeffpc_init(&init_ops);
 
 	while ((opt = getopt(argc, argv, "pcCv")) != -1) {
 		switch (opt) {
--- a/test_fmt3.c	Thu Apr 13 00:49:54 2017 -0400
+++ b/test_fmt3.c	Thu Apr 13 11:18:44 2017 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ * Copyright (c) 2013-2017 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -31,7 +31,6 @@
 #include "utils.h"
 #include "math.h"
 #include "file_cache.h"
-#include "debug.h"
 
 static int onefile(struct post *post, char *ibuf, size_t len)
 {
@@ -91,10 +90,8 @@
 	result = 0;
 
 	ASSERT0(putenv("UMEM_DEBUG=default,verbose"));
-	ASSERT0(putenv("BLAHG_DISABLE_SYSLOG=1"));
 
 	init_math(false);
-	jeffpc_init(&init_ops);
 	init_file_cache();
 
 	for (i = 1; i < argc; i++) {