#!/usr/bin/env bash set -e source $(dirname $0)/env.sh cd $LUNA_ROOT SOURCES=($(find kernel/src -type f | grep -v "\.asm" | grep -v "bootboot.h")) SOURCES+=($(find libluna/src -type f)) SOURCES+=($(find libluna/include/luna -type f | grep -v "Types.h")) SUCCESS=1 lint-file() { info="$(grep -Hnow $1 $3 | awk -v wrong="$1" -v right="$2" 'BEGIN { FS=":" }{ print $1 ":" $2 ": " wrong " -> " right }')" if ! [ "$info" = "" ] then echo "$info" SUCCESS=0 fi } for f in ${SOURCES[@]} do lint-file uint8_t u8 $f lint-file uint16_t u16 $f lint-file uint32_t u32 $f lint-file uint64_t u64 $f lint-file int8_t i8 $f lint-file int16_t i16 $f lint-file int32_t i32 $f lint-file int64_t i64 $f lint-file size_t usize $f lint-file ssize_t isize $f done if [ "$SUCCESS" = "0" ] then exit 1 else echo All files OK fi