diff options
author | Sven Gothel <[email protected]> | 2023-11-28 12:35:49 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-11-28 12:35:49 +0100 |
commit | 4c286a85fb8b8e469d39de1811c2daebcc534a37 (patch) | |
tree | 9c1ab0e5a4b1e6185bdf08b2b2c12cd4544a17db /make | |
parent | 5746f41792d422fe8ff17532d3f7a2b48b721a37 (diff) |
Bug 1476: Reviewed updated OpenAL header (extensions) via make/scripts/cmpOld2New.sh
No API change of old methods or fields!
Diffstat (limited to 'make')
-rw-r--r-- | make/config/joal-common.cfg | 1 | ||||
-rwxr-xr-x | make/scripts/cmpOld2New.sh | 22 | ||||
-rwxr-xr-x | make/scripts/strip-c-comments.awk | 59 |
3 files changed, 82 insertions, 0 deletions
diff --git a/make/config/joal-common.cfg b/make/config/joal-common.cfg index 36a8e8b..94a4402 100644 --- a/make/config/joal-common.cfg +++ b/make/config/joal-common.cfg @@ -59,3 +59,4 @@ ArgumentIsString alcLoopbackOpenDeviceSOFT 0 ## Specify the return length of this function with our own custom strlen ##ReturnValueCapacity alcGetStringImpl strlen_alc(_device_ptr, {1}, _res) +Ignore HAS_STDDEF diff --git a/make/scripts/cmpOld2New.sh b/make/scripts/cmpOld2New.sh new file mode 100755 index 0000000..76f7216 --- /dev/null +++ b/make/scripts/cmpOld2New.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +dirscript=`dirname $0` + +dirold=../build-old/gensrc/classes/com/jogamp/openal +dirnew=../build/gensrc/classes/com/jogamp/openal +dircmp=cmp-old2new + +rm -rf $dircmp +mkdir -p $dircmp + +for i in AL ALC ALCConstants ALCcontext ALCdevice ALConstants ALExt ALExtConstants ; do + echo + echo processing $i + awk -f $dirscript/strip-c-comments.awk $dirold/$i.java | sort -u > $dircmp/$i-old.java + echo created $dircmp/$i-old.java + awk -f $dirscript/strip-c-comments.awk $dirnew/$i.java | sort -u > $dircmp/$i-new.java + echo created $dircmp/$i-new.java + diff -Nurdw $dircmp/$i-old.java $dircmp/$i-new.java > $dircmp/$i-diff.txt + echo created $dircmp/$i-diff.txt +done + diff --git a/make/scripts/strip-c-comments.awk b/make/scripts/strip-c-comments.awk new file mode 100755 index 0000000..4f35452 --- /dev/null +++ b/make/scripts/strip-c-comments.awk @@ -0,0 +1,59 @@ +#!/usr/bin/awk + +BEGIN { ORS = "" ; C99=1 } + +{ code = code $0 "\n" } + +END { + while ( length(code) ) + code = process( code ) +} + +function process( text ) +{ + if ( C99 ) { + if ( match( text, /"|'|\/\*|\/\// ) ) { + return span( text ) + } + } else if ( match( text, /"|'|\/\*/ ) ) { + return span( text ) + } + print text + return "" +} + +function span( text , starter ) +{ + print substr( text, 1, RSTART - 1 ) + starter = substr( text, RSTART, RLENGTH ) + text = substr( text, RSTART + RLENGTH ) + + if ( "\"" == starter || "'" == starter ) { + return quoted( text, starter ) + } + if ( "//" == starter ) { + return remove( text, "\n", "\n" ) + } + ## Allow for + ## /* foo *\ + ## / + return remove( text, "\\*(\\\\\n)?/", " " ) +} + +function remove( text, ender, replacement ) +{ + print replacement + return substr( text, match(text, ender) + RLENGTH ) +} + +function quoted( text, starter ) +{ + if ( "'" == starter ) { + match( text, /^(\\.|[^'])*'/ ) + } else { + match( text, /^(\\.|\?\?\/.|[^"])*"/ ) + } + print starter substr( text, 1, RLENGTH ) + return substr( text, RSTART + RLENGTH ) +} + |