summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-oe/recipes-extended/md5deep/files/0001-Fix-literal-and-identifier-spacing-as-dictated-by-C-.patch
blob: 69460b314b65236250b403f229dcf9861ceb55cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
From 7d7b60e38ca701819d4d00b38161faddce01e2ae Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 6 Sep 2018 23:21:22 -0700
Subject: [PATCH] Fix literal and identifier spacing as dictated by C++11

Fixes clang error like below

error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
|         status("  Known files not found: %"PRIu64, this->match.unused);

Upstream-Status: Submitted [https://github.com/jessek/hashdeep/pull/385/commits/18a6b5d57f7a648d2b7dcc6e50ff00a1e4b05fcc]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/display.cpp  | 16 ++++++++--------
 src/files.cpp    |  4 ++--
 src/hash.cpp     |  2 +-
 src/hashlist.cpp |  4 ++--
 src/xml.h        |  2 +-
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/display.cpp b/src/display.cpp
index b23335d..2eddc23 100644
--- a/src/display.cpp
+++ b/src/display.cpp
@@ -311,7 +311,7 @@ void display::display_realtime_stats(const file_data_hasher_t *fdht, const hash_
 
 	ss << mb_read << "MB of " << fdht->stat_megs() << "MB done, ";
 	char msg[64];
-	snprintf(msg,sizeof(msg),"%02"PRIu64":%02"PRIu64":%02"PRIu64" left", hour, min, seconds);
+	snprintf(msg,sizeof(msg),"%02" PRIu64 ":%02" PRIu64 ":%02" PRIu64 " left", hour, min, seconds);
 	ss << msg;
     }
     ss << "\r";
@@ -424,14 +424,14 @@ void display::display_audit_results()
   
     if (opt_verbose)    {
 	if(opt_verbose >= MORE_VERBOSE){
-	    status("   Input files examined: %"PRIu64, this->match.total);
-	    status("  Known files expecting: %"PRIu64, this->match.expect);
+	    status("   Input files examined: %" PRIu64, this->match.total);
+	    status("  Known files expecting: %" PRIu64, this->match.expect);
 	}
-	status("          Files matched: %"PRIu64, this->match.exact);
-	status("Files partially matched: %"PRIu64, this->match.partial);
-	status("            Files moved: %"PRIu64, this->match.moved);
-	status("        New files found: %"PRIu64, this->match.unknown);
-	status("  Known files not found: %"PRIu64, this->match.unused);
+	status("          Files matched: %" PRIu64, this->match.exact);
+	status("Files partially matched: %" PRIu64, this->match.partial);
+	status("            Files moved: %" PRIu64, this->match.moved);
+	status("        New files found: %" PRIu64, this->match.unknown);
+	status("  Known files not found: %" PRIu64, this->match.unused);
     }
 }
 
diff --git a/src/files.cpp b/src/files.cpp
index 89c6984..3dfd363 100644
--- a/src/files.cpp
+++ b/src/files.cpp
@@ -509,7 +509,7 @@ int state::parse_encase_file(const char *fn, FILE *handle,uint32_t expected_hash
         
 	    // Users expect the line numbers to start at one, not zero.
 	    if ((!ocb.opt_silent) || (mode_warn_only)) {
-		ocb.error("%s: No hash found in line %"PRIu32, fn, count + 1);
+		ocb.error("%s: No hash found in line %" PRIu32, fn, count + 1);
 		ocb.error("%s: %s", fn, strerror(errno));
 		return status_t::STATUS_USER_ERROR;
 	    }
@@ -542,7 +542,7 @@ int state::parse_encase_file(const char *fn, FILE *handle,uint32_t expected_hash
     }
 
     if (expected_hashes != count){
-	ocb.error("%s: Expecting %"PRIu32" hashes, found %"PRIu32"\n", 
+	ocb.error("%s: Expecting %" PRIu32 " hashes, found %" PRIu32 "\n", 
 			fn, expected_hashes, count);
     }
     return status_t::status_ok;
diff --git a/src/hash.cpp b/src/hash.cpp
index 52f419b..a4b3128 100644
--- a/src/hash.cpp
+++ b/src/hash.cpp
@@ -124,7 +124,7 @@ bool file_data_hasher_t::compute_hash(uint64_t request_start,uint64_t request_le
     
 	// If an error occured, display a message and see if we need to quit.
 	if ((current_read_bytes<0) || (this->handle && ferror(this->handle))){
-	    ocb->error_filename(this->file_name,"error at offset %"PRIu64": %s",
+	    ocb->error_filename(this->file_name,"error at offset %" PRIu64 ": %s",
 				request_start, strerror(errno));
 	   
 	    if (file_fatal_error()){
diff --git a/src/hashlist.cpp b/src/hashlist.cpp
index b5b275f..eb0d45a 100644
--- a/src/hashlist.cpp
+++ b/src/hashlist.cpp
@@ -342,7 +342,7 @@ hashlist::load_hash_file(display *ocb,const std::string &fn)
     file_data_t *t = new (std::nothrow) file_data_t();
     if (NULL == t)
     {
-      ocb->fatal_error("%s: Out of memory in line %"PRIu64,
+      ocb->fatal_error("%s: Out of memory in line %" PRIu64,
 		       fn.c_str(), line_number);
     }
 
@@ -390,7 +390,7 @@ hashlist::load_hash_file(display *ocb,const std::string &fn)
       if ( !algorithm_t::valid_hash(hash_column[column_number],word))
       {
 	if (ocb)
-	  ocb->error("%s: Invalid %s hash in line %"PRIu64,
+	  ocb->error("%s: Invalid %s hash in line %" PRIu64,
 		     fn.c_str(),
 		     hashes[hash_column[column_number]].name.c_str(),
 		     line_number);
diff --git a/src/xml.h b/src/xml.h
index bfe0c94..017dba7 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -100,7 +100,7 @@ public:
     void xmlout(const std::string &tag,const std::string &value){ xmlout(tag,value,"",true); }
     void xmlout(const std::string &tag,const int value){ xmlprintf(tag,"","%d",value); }
     void xmloutl(const std::string &tag,const long value){ xmlprintf(tag,"","%ld",value); }
-    void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,"","%"PRId64,value); }
+    void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,"","%" PRId64,value); }
     void xmlout(const std::string &tag,const double value){ xmlprintf(tag,"","%f",value); }
     void xmlout(const std::string &tag,const struct timeval &ts){
 	xmlprintf(tag,"","%d.%06d",(int)ts.tv_sec, (int)ts.tv_usec);
-- 
2.18.0

OpenPOWER on IntegriCloud