Skip to content

Commit 497429d

Browse files
committed
cleanup(userspace): Include inttypes.h or cinttypes where needed
Make sure our printf format constants are defined. Signed-off-by: Gerald Combs <[email protected]>
1 parent 83501c6 commit 497429d

File tree

16 files changed

+21
-2
lines changed

16 files changed

+21
-2
lines changed

userspace/libscap/examples/01-open/scap_open.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616
1717
*/
1818

19+
#include <inttypes.h>
1920
#include <stdio.h>
2021
#include <stdlib.h>
2122
#include <signal.h>

userspace/libscap/examples/02-validatebuffer/test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616
1717
*/
1818

19+
#include <inttypes.h>
1920
#include <stdio.h>
2021
#include <stdlib.h>
2122
#include <sys/types.h>

userspace/libscap/linux/scap_machine_info.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ limitations under the License.
2222
#include <libscap/scap_assert.h>
2323
#include <libscap/scap.h>
2424

25+
#include <inttypes.h>
2526
#include <stdbool.h>
2627
#include <stdio.h>
2728
#include <sys/stat.h>

userspace/libscap/linux/scap_procs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
*/
1818

1919
#include <errno.h>
20+
#include <inttypes.h>
2021
#include <stdio.h>
2122
#include <stdlib.h>
2223
#include <string.h>

userspace/libscap/scap_event.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616
1717
*/
1818

19+
#include <inttypes.h>
1920
#include <stdio.h>
2021
#include <stdlib.h>
2122
#include <time.h>

userspace/libscap/scap_print_event.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
1313
limitations under the License.
1414
*/
1515

16+
#include <inttypes.h>
1617
#include <stdio.h>
1718
#include <libscap/scap.h>
1819
#include <libscap/scap-int.h>

userspace/libsinsp/event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ limitations under the License.
1919
#include <libsinsp/sinsp_errno.h>
2020

2121
#ifndef _WIN32
22-
#include <inttypes.h>
2322
#include <sys/socket.h>
2423
#include <algorithm>
2524
#include <unistd.h>
2625
#else
2726
#define localtime_r(a, b) (localtime_s(b, a) == 0 ? b : NULL)
2827
#endif
2928

29+
#include <cinttypes>
3030
#include <limits>
3131
#include <string>
3232
#include <optional>

userspace/libsinsp/fdtable.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ limitations under the License.
1919
#ifndef _WIN32
2020
#include <algorithm>
2121
#endif
22+
#include <cinttypes>
23+
2224
#include <libsinsp/fdtable.h>
2325
#include <libsinsp/sinsp_int.h>
2426
#include <libscap/scap-int.h>

userspace/libsinsp/parsers.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ limitations under the License.
2727
#include <stdio.h>
2828
#include <stdlib.h>
2929
#include <fcntl.h>
30+
#include <cinttypes>
3031
#include <limits>
3132

3233
#include <libsinsp/sinsp.h>

userspace/libsinsp/sinsp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ limitations under the License.
3838
#include <sys/time.h>
3939
#endif // _WIN32
4040

41+
#include <cinttypes>
4142
#include <cstdio>
4243
#include <cstdlib>
4344
#include <cstring>

0 commit comments

Comments
 (0)