#!/bin/sh

PREFIX=`dirname $0`
PREFIX="$PREFIX/../.."

RMBDIR=/tmp/tmp_rmb

mkdir -p $RMBDIR || exit 1

cd $PREFIX

for file in src/*/*.[ch] \
            po/*.po \
            gui/*/*.py bin/*.py bin/*.in bin/runcase* \
            libple/*/*.[ch] preprocessor/*/*.[ch] \
            salome/fsi_coupling/libmilieu/*.[ch] \
            salome/fsi_coupling/src/*/*.[ch]xx
do
  tmpfile=`basename $file`
  sed -e 's/\%\([0-9]*\)llu/\%\1I64u/g' -e 's/\%\([0-9]*\)lld/\%\1I64d/g' $file > $RMBDIR/$tmpfile
  diff $file $RMBDIR/$tmpfile > /dev/null 2>&1
  if [ $? = 1 ]
  then
    echo $file
    mv $RMBDIR/$tmpfile $file
  fi
done

\rm -rf $RMBDIR

