updated most things to work on Wheezy
I haven't done the new opencv packages yet, so I just didn't test
compiling that stuff.
Almost all of the changes were related to user-defined string literals
breaking things like "%"PRIu32" (in our code and other people's).
diff --git a/aos/common/Configuration.cpp b/aos/common/Configuration.cpp
index 2c9a7be..edf5212 100644
--- a/aos/common/Configuration.cpp
+++ b/aos/common/Configuration.cpp
@@ -14,6 +14,7 @@
#else
#include <ifaddrs.h>
#endif
+#include <unistd.h>
#ifndef __VXWORKS__
#include "aos/common/logging/logging.h"
diff --git a/aos/common/input/driver_station_data.cc b/aos/common/input/driver_station_data.cc
index 803d46a..6b078d4 100644
--- a/aos/common/input/driver_station_data.cc
+++ b/aos/common/input/driver_station_data.cc
@@ -30,6 +30,8 @@
return values.control.autonomous();
case ControlBit::kEnabled:
return values.control.enabled();
+ default:
+ __builtin_unreachable();
}
}
diff --git a/aos/common/logging/logging_impl.cc b/aos/common/logging/logging_impl.cc
index 147d6ba..bced835 100644
--- a/aos/common/logging/logging_impl.cc
+++ b/aos/common/logging/logging_impl.cc
@@ -111,8 +111,8 @@
}
void PrintMessage(FILE *output, const LogMessage &message) {
- fprintf(output, "%s(%"PRId32")(%05"PRIu16"): %s at"
- " %010"PRId32".%09"PRId32"s: %s",
+ fprintf(output, "%s(%" PRId32 ")(%05" PRIu16 "): %s at"
+ " %010" PRId32 ".%09" PRId32 "s: %s",
message.name, static_cast<int32_t>(message.source), message.sequence,
log_str(message.level), message.seconds, message.nseconds,
message.message);
diff --git a/aos/common/logging/logging_impl_test.cc b/aos/common/logging/logging_impl_test.cc
index f64f3d6..16a0285 100644
--- a/aos/common/logging/logging_impl_test.cc
+++ b/aos/common/logging/logging_impl_test.cc
@@ -53,7 +53,7 @@
}
internal::Context *context = internal::Context::Get();
if (log_implementation->message().source != context->source) {
- Die("got a message from %"PRIu32", but we're %"PRIu32"\n",
+ Die("got a message from %" PRIu32 ", but we're %" PRIu32 "\n",
static_cast<uint32_t>(log_implementation->message().source),
static_cast<uint32_t>(context->source));
}
diff --git a/aos/common/queue.cc b/aos/common/queue.cc
index 7e7f2a1..b3a4799 100644
--- a/aos/common/queue.cc
+++ b/aos/common/queue.cc
@@ -30,7 +30,7 @@
}
size_t Message::Print(char *buffer, int length) const {
- return snprintf(buffer, length, "%"PRId32".%09"PRId32"s",
+ return snprintf(buffer, length, "%" PRId32 ".%09" PRId32 "s",
sent_time.sec(), sent_time.nsec());
}
diff --git a/aos/common/scoped_fd.h b/aos/common/scoped_fd.h
index f31ffa5..eb22f80 100644
--- a/aos/common/scoped_fd.h
+++ b/aos/common/scoped_fd.h
@@ -1,3 +1,5 @@
+#include <unistd.h>
+
#include "aos/common/macros.h"
#include "aos/common/logging/logging.h"
diff --git a/aos/common/sensors/sensor_receiver-tmpl.h b/aos/common/sensors/sensor_receiver-tmpl.h
index 2220496..8ebef22 100644
--- a/aos/common/sensors/sensor_receiver-tmpl.h
+++ b/aos/common/sensors/sensor_receiver-tmpl.h
@@ -71,7 +71,8 @@
}
#endif
} else {
- LOG(INFO, "packet %"PRId32" late. is packet #%d, wanted #%"PRId64" now\n",
+ LOG(INFO,
+ "packet %" PRId32 " late. is packet #%d, wanted #%" PRId64 " now\n",
data_.count, (data_.count - start_count_) / kSendsPerCycle,
(NextLoopTime() - start_time_).ToNSec() / kLoopFrequency.ToNSec());
good = false;
@@ -163,8 +164,8 @@
ReceiveData();
received_time = time::Time::Now();
if (GoodPacket()) {
- LOG(DEBUG, "checking packet count=%"PRId32
- " received at %"PRId32"s%"PRId32"ns\n",
+ LOG(DEBUG, "checking packet count=%" PRId32
+ " received at %" PRId32 "s%" PRId32 "ns\n",
data_.count, received_time.sec(), received_time.nsec());
// If |the difference between the goal time for this numbered packet
// and the time we actually got this one| is too big.
@@ -172,7 +173,8 @@
kSensorSendFrequency * (data_.count - start_count_)) -
received_time).abs() > kSensorSendFrequency) {
LOG(INFO, "rejected time of the last good packet. "
- "got %"PRId32"s%"PRId32"ns. wanted %"PRId32"s%"PRId32"ns\n",
+ "got %" PRId32 "s%" PRId32 "ns."
+ " wanted %" PRId32 "s%" PRId32 "ns\n",
received_time.sec(), received_time.nsec(),
goal_time.sec(), goal_time.nsec());
++bad_count;
@@ -199,18 +201,18 @@
DoReceiveData();
if (data_.count < 0) {
- LOG(FATAL, "data count overflowed. currently %"PRId32"\n", data_.count);
+ LOG(FATAL, "data count overflowed. currently %" PRId32 "\n", data_.count);
}
if (data_.count < old_count) {
- LOG(INFO, "count reset. was %"PRId32", now %"PRId32"\n",
+ LOG(INFO, "count reset. was %" PRId32 ", now %" PRId32 "\n",
old_count, data_.count);
return true;
}
if (data_.count < start_count_) {
- LOG(INFO, "count reset. started at %"PRId32", now %"PRId32"\n",
+ LOG(INFO, "count reset. started at %" PRId32 ", now %" PRId32 "\n",
start_count_, data_.count);
}
- LOG(DEBUG, "received data count %"PRId32"\n", data_.count);
+ LOG(DEBUG, "received data count %" PRId32 "\n", data_.count);
return false;
}
diff --git a/aos/common/sensors/sensors.h b/aos/common/sensors/sensors.h
index a6b2bfa..78fd8a9 100644
--- a/aos/common/sensors/sensors.h
+++ b/aos/common/sensors/sensors.h
@@ -69,7 +69,7 @@
sizeof(checksum),
sizeof(*this) - sizeof(checksum));
if (checksum != expected) {
- LOG(INFO, "expected %"PRIx32" but got %"PRIx32"\n",
+ LOG(INFO, "expected %" PRIx32 " but got %" PRIx32 "\n",
expected, checksum);
return false;
}
diff --git a/aos/common/time.cc b/aos/common/time.cc
index 75ea196..bc3ffe2 100644
--- a/aos/common/time.cc
+++ b/aos/common/time.cc
@@ -70,7 +70,7 @@
void Time::Check() {
if (nsec_ >= kNSecInSec || nsec_ < 0) {
- LOG(FATAL, "0 <= nsec_(%"PRId32") < %"PRId32" isn't true.\n",
+ LOG(FATAL, "0 <= nsec_(%" PRId32 ") < %" PRId32 " isn't true.\n",
nsec_, kNSecInSec);
}
static_assert(aos::shm_ok<Time>::value,