Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug Fix for Clang compilers
  • Loading branch information
Emily Sarneso authored and Emily Sarneso committed Mar 15, 2018
1 parent 7e83e47 commit e461cdf
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 18 deletions.
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,6 +1,6 @@
BigGrep

Copyright 2017 Carnegie Mellon University. All Rights Reserved.
Copyright 2017-2018 Carnegie Mellon University. All Rights Reserved.

GNU GPL 2.0

Expand Down
7 changes: 6 additions & 1 deletion NEWS
@@ -1,6 +1,11 @@
Version 2.7.1: 2017-12-04
Version 2.7.2: 2018-03-15
==========================

Bug fix for Clang compilers

Version 2.7.1: 2017-12-04
===========================

bgindex bug fix

Version 2.7: 2017-08-15
Expand Down
2 changes: 1 addition & 1 deletion biggrep.spec
Expand Up @@ -4,7 +4,7 @@
%define __spec_install_post %{nil}
%define debug_package %{nil}
%define __os_install_post %{_dbpath}/brp-compress
%define version 2.7.1
%define version 2.7.2
%define release 1

Summary: CERT biggrep
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Expand Up @@ -12,10 +12,10 @@ dnl ------------------------------------------------------------------------


AC_PREREQ(2.59)
AC_INIT([biggrep], [2.7.1], [https://github.com/cmu-sei/BigGrep/issues],[biggrep])
AC_INIT([biggrep], [2.7.2], [https://github.com/cmu-sei/BigGrep/issues],[biggrep])
AC_CONFIG_SRCDIR([.])
AC_CONFIG_HEADERS(src/bgconfig.h)
AC_COPYRIGHT([Copyright (C) 2011-2017 by Carnegie Mellon University
AC_COPYRIGHT([Copyright (C) 2011-2018 by Carnegie Mellon University
Government Purpose License Rights (GPLR) pursuant to DFARS 252.227-7013])
AC_REVISION([$Id: $])
AC_CONFIG_AUX_DIR([autoconf])
Expand Down
19 changes: 16 additions & 3 deletions src/Logger.hpp
Expand Up @@ -20,6 +20,12 @@
// LERROR << "Danger Will Robinson" << LEND;
// LCRITICAL << "This message will self destruct..." << std::endl;
//
// If you need to exclude some more extensive processing than what can be
// placed in a single line stream operation like above, there are some
// helper macros for that too:
// if (LISDEBUG) { ... }
// if (LISLOGLEVEL(Logger.INFO)) { ... }
//
// Default behavior can be controlled via some env vars (useful for
// integration into new code that doesn't do cmd line processing).
// Specifically LOGGER_LEVEL can be set to set the default log level either
Expand All @@ -31,6 +37,10 @@
// LDEBUG and above for anything in bar.cpp. It uses the Boost Tokenizer
// code for parsing the environment variable.
//
// There's a LOGGER_TIMESTAMP env var too, to make that go away by setting
// it to an empty string (for automated unit test comparisons, for example)
// or change the format from the default for some other reason.
//
// Now relies on Boost Thread library for limited thread safety. Still can
// get garbled output though, since stream usage isn't really thread safe...
// I could probably make it a little better if I'd have stuck closer to the
Expand Down Expand Up @@ -391,12 +401,15 @@ class Logger {
// the else parameter too to work, not void like I have here, and since log
// returns a std::ostream&, that's probably not going to work either, so I'll
// just stick with the empty expression for now:
#define LNOOP
//#define LNOOP
//#define LNOOP (void)0
//#define LNOOP [](){}()

#define LOG(level) (level < Logger::logger()->getLoggerLevel(__FILE__,__LINE__)) ? LNOOP : Logger::logger()->log(level)
#define LOGcnt(level) (level < Logger::logger()->getLoggerLevel(__FILE__,__LINE__)) ? LNOOP : Logger::logger()->log(level,false)
//#define LOG(level) (level < Logger::logger()->getLoggerLevel(__FILE__,__LINE__)) ? LNOOP : Logger::logger()->log(level)
//#define LOGcnt(level) (level < Logger::logger()->getLoggerLevel(__FILE__,__LINE__)) ? LNOOP : Logger::logger()->log(level,false)
// actually, short circuits might work out for this:
#define LOG(level) (level >= Logger::logger()->getLoggerLevel(__FILE__,__LINE__)) && Logger::logger()->log(level)
#define LOGcnt(level) (level >= Logger::logger()->getLoggerLevel(__FILE__,__LINE__)) && Logger::logger()->log(level,false)

#endif // 0

Expand Down
4 changes: 2 additions & 2 deletions src/bgextractfile.cpp
@@ -1,4 +1,4 @@
// Copyright 2017 Carnegie Mellon University. See LICENSE file for terms.
// Copyright 2018 Carnegie Mellon University. See LICENSE file for terms.
// BigGrep, bgextractfile: code to extract/remove/replace a file from a biggrep index

#define __STDC_LIMIT_MACROS // I have to define this to get UINT32_MAX because of the ISO C99 standard, apparently
Expand Down Expand Up @@ -59,7 +59,7 @@ namespace io = boost::iostreams;
void version() {

std::cerr << "bgextractfile version " << VERSION << std::endl;
std::cerr << "(c) 2017 Carnegie Mellon University " << std::endl;
std::cerr << "(c) 2017-2018 Carnegie Mellon University " << std::endl;
std::cerr << "Government Purpose License Rights (GPLR) pursuant to "
"DFARS 252.227-7013" << std::endl;
std::cerr << "Post issues to https://github.com/cmu-sei/BigGrep" << std::endl;
Expand Down
10 changes: 6 additions & 4 deletions src/bgindex_th.cpp
@@ -1,4 +1,4 @@
// Copyright 2011-2017 Carnegie Mellon University. See LICENSE file for terms.
// Copyright 2011-2018 Carnegie Mellon University. See LICENSE file for terms.
#define __STDC_LIMIT_MACROS // I have to define this to get UINT32_MAX because of the ISO C99 standard, apparently
// #define __STDC_CONSTANT_MACROS // don't really need these right now
#include <stdint.h>
Expand Down Expand Up @@ -748,7 +748,9 @@ void bgShingle(
fd->hit_ngram_limit = true;
//lt->nodes[id].fd = NULL;
if (overflow) {
fputs(fname.c_str(),overflow);
/* add metadata to output string */
//fputs(fname.c_str(),overflow);
fputs(id_to_fname[id].c_str(), overflow);
fputs("\n",overflow);
}
} else {
Expand All @@ -763,7 +765,7 @@ void bgShingle(
" took %f sec") % fname.c_str() %
int(id) % unique_ngrams %
ngram_size % int(ngram_count) %
stimer.secondsFromStart();
stimer.secondsFromStart();
}

}
Expand Down Expand Up @@ -1397,7 +1399,7 @@ void version()
{

std::cerr << "bgindex version " << VERSION << std::endl;
std::cerr << "(c) 2011-2017 Carnegie Mellon University " << std::endl;
std::cerr << "(c) 2011-2018 Carnegie Mellon University " << std::endl;
std::cerr << "Government Purpose License Rights (GPLR) pursuant to "
"DFARS 252.227-7013" << std::endl;
std::cerr << "Post issues to https://github.com/cmu-sei/BigGrep" << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions src/bgparse.cpp
@@ -1,4 +1,4 @@
// Copyright 2011-2017 Carnegie Mellon University. See LICENSE file for terms.
// Copyright 2011-2018 Carnegie Mellon University. See LICENSE file for terms.
// BigGrep, bgparse: code to parse the BGI file format to do searches
// (bgsearch.py will call this), extract stats, etc.

Expand Down Expand Up @@ -144,7 +144,7 @@ void ngrams_sort_and_uniq(
void version() {

std::cerr << "bgparse version " << VERSION << std::endl;
std::cerr << "(c) 2011-2017 Carnegie Mellon University " << std::endl;
std::cerr << "(c) 2011-2018 Carnegie Mellon University " << std::endl;
std::cerr << "Government Purpose License Rights (GPLR) pursuant to "
"DFARS 252.227-7013" << std::endl;
std::cerr << "Post issues to https://github.com/cmu-sei/BigGrep" << std::endl;
Expand Down
4 changes: 2 additions & 2 deletions src/bgverify.cpp
@@ -1,4 +1,4 @@
// Copyright 2011-2017 Carnegie Mellon University. See LICENSE file for terms.
// Copyright 2011-2018 Carnegie Mellon University. See LICENSE file for terms.
// BigGrep, bgverify: uses a C++ implementation of Boyer-Moore-Horspool fast
// string searching to do a "binary grep" to do a simplistic verification of
// potential matches from bgsearch
Expand Down Expand Up @@ -78,7 +78,7 @@ BMH::find(unsigned char *txt, int len, bool onlyone)
void version() {

std::cerr << "bgverify version " << VERSION << std::endl;
std::cerr << "(c) 2011-2017 Carnegie Mellon University " << std::endl;
std::cerr << "(c) 2011-2018 Carnegie Mellon University " << std::endl;
std::cerr << "Government Purpose License Rights (GPLR) pursuant to "
"DFARS 252.227-7013" << std::endl;
std::cerr << "Post issues to https://github.com/cmu-sei/BigGrep" <<
Expand Down

0 comments on commit e461cdf

Please sign in to comment.