Fixes some warnings

- Implicit decleared function
- Unused variable

Change-Id: Ia701e66682cb6788f0716a2ef7556ed07227f78f
Avoid redefinition of  __STDC_FORMAT_MACROS.

Change-Id: I5c65ea196bb9a197a74899ceb53543f289f6d494
Fix a bunch of small system/core bugs.

Missing frees in:
  adb/file_sync_client.c
  fastboot/fastboot.c
  libsparse/output_file.c

Missing closedirs in:
  adb/file_sync_service.c
  cpio/mkbootfs.c
  libcutils/dir_hash.c

Potential buffer overrun in:
  gpttool/gpttool.c

Incorrect NULL check in:
  libsparse/backed_block.c

Bug: https://code.google.com/p/android/issues/detail?id=61564
Change-Id: If97838a9e73a77aef7f416c31c237ce1fca4ce21
restorecon_recursive("/sys") speed boot time

Currently, the restorecon_recursive("/sys") call in
init.c takes approx 2 seconds on hammerhead. This change
reduces the delay to 1.2 seconds.

1) Avoid double stat call when using nftw (time savings
of 0.3 seconds)
2) Avoid the repeated calls to is_selinux_enabled() (time
savings of 0.5 seconds)

Avoid calling lsetfilecon if the file is already properly
labeled. This doesn't speed up the restorecon on /sys,
but it should help when handling files on /data.

Change-Id: Icf344edc5bfc9520d3a0ebd9527a065d29832f87
restorecon /data/misc/media.

Otherwise it will be mislabeled on upgrades with existing userdata.

Change-Id: Ibde88d5d692ead45b480bb34cfe0831baeffbf94
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
<utils/Errors.h>: Fix c++11 narrowing

Summary:
C style casting opposed to static casting was used here due to Errors.h being included by C as well.

Depends on D309

Test Plan: verified

Reviewers: randall.rushing, jriordan001

Reviewed By: randall.rushing

Differential Revision: http://review.codefirex.com/D310

Change-Id: Iedbcb817ef20a49e215e7ed6bd535a0a63125baf
Signed-off-by: DHOMD <DHO@dho.im>
<system/audio.h>: do not use GNU old-style field designators

Avoiding the use of GCC extensions improves code
portability

Change-Id: I896118eb30951903b562bab95de3bc18d22db98a
Signed-off-by: DHOMD <DHO@dho.im>
<utils/Macros.h>: introduce

Summary:
Issue:
These macros are non-standard to the C standard, but standard in GCC.
This causes issues since compiler-rt assumes we provide these when built with
LLVM Clang.

Solution:
Include these macros as a easy to utilize header.

Test Plan: verification is a WIP

Reviewers: randall.rushing, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D107

Change-Id: If4f06e75f0b42f9656618ee3dad6f8a4a997a377
Signed-off-by: DHOMD <DHO@dho.im>