touch up 64bit build cleanliness

Some of the types being used happened to work on 32bit systems because
size_t is pretty much an unsigned int.  But with a 64bit system, we see:

kernel_collector.cc: In member function
  'virtual bool KernelCollector::LoadParameters()':
kernel_collector.cc:141: error: cannot convert 'size_t*' to 'unsigned int*'
  for argument '2' to 'bool LoadValue(FilePath, unsigned int*)'

This is easy to fix by using the correct type in LoadValue().

Next up, we get a failure due to the assumption that int64 can be
displayed using the lld format string.  But on 64bit systems, this
doesn't work:

crash_collector.cc: In member function
  'void CrashCollector::WriteCrashMetaData(const FilePath&, const std::string&, const std::string&)':
crash_collector.cc:355: error:
  format '%lld' expects type 'long long int', but argument 6 has type 'int64'

This takes a little bit more magic to make work.  Since printf itself
does not provide a printf string to handle "64bit" types, use the macros
that POSIX provides in inttypes.h.  The printf string is a little uglier,
but now should work for all targets.

BUG=chromium-os:20636
TEST=`emerge-amd64-generic crash-reporter` now works
TEST=`emerge-x86-generic crash-reporter` still works
TEST=build+booting x86-alex still works

Change-Id: I8401f2ad932223085dfbe54541590e9b65297783
Reviewed-on: http://gerrit.chromium.org/gerrit/8051
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Michael Krebs <mkrebs@chromium.org>
2 files changed
tree: 28b4545f436eee58b48aa8607a195876e8e39f4b
  1. crash_reporter/