BAD=""
-git grep 'namespace rocksdb' -- '*.[ch]*'
+git grep -n 'namespace rocksdb' -- '*.[ch]*'
if [ "$?" != "1" ]; then
echo "^^^^^ Do not hardcode namespace rocksdb. Use ROCKSDB_NAMESPACE"
BAD=1
fi
-git grep -i 'nocommit' -- ':!build_tools/check-sources.sh'
+git grep -n -i 'nocommit' -- ':!build_tools/check-sources.sh'
if [ "$?" != "1" ]; then
echo "^^^^^ Code was not intended to be committed"
BAD=1
fi
-git grep '<rocksdb/' -- ':!build_tools/check-sources.sh'
+git grep -n '<rocksdb/' -- ':!build_tools/check-sources.sh'
if [ "$?" != "1" ]; then
echo '^^^^^ Use double-quotes as in #include "rocksdb/something.h"'
BAD=1
fi
-git grep 'using namespace' -- ':!build_tools' ':!docs' \
+git grep -n 'using namespace' -- ':!build_tools' ':!docs' \
':!third-party/folly/folly/lang/Align.h' \
':!third-party/gtest-1.8.1/fused-src/gtest/gtest.h'
if [ "$?" != "1" ]; then
BAD=1
fi
+git grep -n -P "[\x80-\xFF]" -- ':!docs' ':!*.md'
+if [ "$?" != "1" ]; then
+ echo '^^^^ Use only ASCII characters in source files'
+ BAD=1
+fi
+
if [ "$BAD" ]; then
exit 1
fi
if (throughput_mbs_.size() == throughput_ops_.size()) {
fprintf(stdout,
- "%s [AVG %d runs] : %d (± %d) ops/sec; %6.1f (± %.1f) MB/sec\n",
+ "%s [AVG %d runs] : %d (\xC2\xB1 %d) ops/sec; %6.1f (\xC2\xB1 "
+ "%.1f) MB/sec\n",
name, num_runs, static_cast<int>(CalcAvg(throughput_ops_)),
static_cast<int>(CalcConfidence95(throughput_ops_)),
CalcAvg(throughput_mbs_), CalcConfidence95(throughput_mbs_));
} else {
- fprintf(stdout, "%s [AVG %d runs] : %d (± %d) ops/sec\n", name, num_runs,
- static_cast<int>(CalcAvg(throughput_ops_)),
+ fprintf(stdout, "%s [AVG %d runs] : %d (\xC2\xB1 %d) ops/sec\n", name,
+ num_runs, static_cast<int>(CalcAvg(throughput_ops_)),
static_cast<int>(CalcConfidence95(throughput_ops_)));
}
}
int num_runs = static_cast<int>(throughput_ops_.size());
if (throughput_mbs_.size() == throughput_ops_.size()) {
+ // \xC2\xB1 is +/- character in UTF-8
fprintf(stdout,
- "%s [AVG %d runs] : %d (± %d) ops/sec; %6.1f (± %.1f) MB/sec\n"
+ "%s [AVG %d runs] : %d (\xC2\xB1 %d) ops/sec; %6.1f (\xC2\xB1 "
+ "%.1f) MB/sec\n"
"%s [MEDIAN %d runs] : %d ops/sec; %6.1f MB/sec\n",
name, num_runs, static_cast<int>(CalcAvg(throughput_ops_)),
static_cast<int>(CalcConfidence95(throughput_ops_)),
CalcMedian(throughput_mbs_));
} else {
fprintf(stdout,
- "%s [AVG %d runs] : %d (± %d) ops/sec\n"
+ "%s [AVG %d runs] : %d (\xC2\xB1 %d) ops/sec\n"
"%s [MEDIAN %d runs] : %d ops/sec\n",
name, num_runs, static_cast<int>(CalcAvg(throughput_ops_)),
static_cast<int>(CalcConfidence95(throughput_ops_)), name,
#include "port/lang.h" // for FALLTHROUGH_INTENDED, inserted as appropriate
/* END RocksDB customizations */
+// clang-format off
/*
* xxHash - Extremely Fast Hash algorithm
* Header File
int i;
for (i=0; i < nbRounds; ++i) {
/* GCC has a bug, _mm512_stream_load_si512 accepts 'void*', not 'void const*',
- * this will warn "discards ‘const’ qualifier". */
+ * this will warn "discards 'const' qualifier". */
union {
XXH_ALIGN(64) const __m512i* cp;
XXH_ALIGN(64) void* p;