summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/cgram
Commit message (Collapse)AuthorAgeFilesLines
* gluegen: remove the unused reverse map from TypeDictionaryHarvey Harrison2014-07-071-9/+0
|
* gluegen: remove unused imports, unneeded semicolons, add missing @Override ↵Harvey Harrison2014-07-071-1/+1
| | | | annotations
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-0328-272/+272
| | | | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Bug 1025 - GlueGen: Add accessor for compound fields of type array, pointer ↵Sven Gothel2014-06-255-38/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and string (code generation) Enhance compound access as delivered by Bug 1022, to also generate accessors (getter and setter) for array, pointer and string types. Allow configuration of array length either via their internal size (c-header) or config 'ReturnedArrayLength'. 'ReturnedArrayLength' allows specifying a java expression. Canonical field names of compounds are _now_ specified as follows for configuration entries: COMPOUND.FIELD e.g. StructA.fieldB Also allow configuration of pointer fields to be treated as referenced arrays via 'ReturnedArrayLength'. Further, allow specifying 'pointer fields' as String values via 'ReturnsString' configuration. ++++ Implementation details: - handle above described accessor features - enhance JavaDoc for generated accessors - generate native JNI compound and string accessor on demand - encapsule accessor code generation in their own methods - enhance exception messages - enhance type verbosity in debug mode - verbose debug output via GlueGen.debug() Tests: - Features covered by test1.[ch] and Test1p1JavaEmitter and Test1p2ProcAddressEmitter - Validated compilation and unit tests for modules: - joal - jogl (minor config changes req.) - jocl (minor config changes req.)
* GlueGen: Add support for compound-array in structs (accessors) ; Allow using ↵Sven Gothel2014-06-191-5/+29
| | | | | | | | | | | | | | | C-Enum values for array length - Parser (HeaderParser.g): Support using C-Enum values for array length specification - Will throw an exception if enum identifier is unknown or exceeds int-size - Add StructEmitter supports for compound-arrays - Add Debug stderr verbose info: - Struct Emitter prefix 'SE.' - to analyze emitting struct fields (offset+size and accessors) - Struct Layout prefix 'SL.' - to analyze memory layout (based on MachineDescription.StaticConfig.X86_64_UNIX) Tested via test1.[ch] BaseClass ..
* GlueGen: Add support for 'compound array call-by-value'Sven Gothel2014-06-172-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Completing commit c3054a01990e55ab35756ea23ab7d7c05f24dd37 by allowing passing compound arrays via 'call-by-value. - Creating linear temp heap, copying NIO values into it and passing to C function. Copy-back if not 'const', see below. - Respect 'const' qualifier to skip write-back of temp heap passed to C function - See tag: // FIXME: Compound and Compound-Arrays for code changes and validation of completeness - triggers for compound arrays are: - javaType.isArrayOfCompoundTypeWrappers() - type.isArray() - simplified const query by c-type: FunctionEmitter.isBaseTypeConst(ctype) +++ Tests: Added call-by-value to test1.[ch] binding test!
* gluegen: remove some unused importsHarvey Harrison2014-05-312-3/+0
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: move all antlr grammars to a top-level directoryHarvey Harrison2014-05-315-5076/+0
| | | | | | | | /src/main/antlr/.. This gets the .g files unmixed from the non-generated java files for the cgram/jgram packages. Signed-off-by: Harvey Harrison <[email protected]>
* Minor Cleanup after merging fixes for bugs 987, 990, 992 and 994Sven Gothel2014-03-101-3/+4
|
* Fix accidental tabs.Wade Walker2014-03-041-4/+4
|
* Remove warnings in emitted C code.Wade Walker2014-03-042-0/+12
| | | | | | | | Fix 1: Only emit "int * _offsetHandle = NULL" if it will be used, to avoid unused variable warning. Fix 2: Add "unsigned" to typecasts in C function calls when needed to avoid implicit typecast warning. This commit also adds a unit test for a method that uses an "unsigned char **" parameter, to mimic the JOCL clCreateProgramWithBinary() function that caused the typecast warnings.
* gluegen: add all missing @Override annotationsHarvey Harrison2013-10-1719-0/+60
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: remove trailing whitespaceHarvey Harrison2013-10-1729-269/+269
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: remove implied use of StringBuffer while appending to StringBuilderHarvey Harrison2013-07-151-2/+2
| | | | | | | - call append on the StringBuilder we are using rather than using String concatenation, which uses StringBuffer. Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: annotate Hastable of attributes as Hashtable<String, Object>Harvey Harrison2013-07-151-11/+11
| | | | | | | - use copy-constructor rather than clone to suppress type warnings - annotate a Class as Class<?> Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: remove unneeded casts to TNodeHarvey Harrison2013-07-151-4/+4
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* FunctionSymbol: Fix equals/hashCode comparison, i.e. skip args/type due to ↵Sven Gothel2013-07-141-7/+25
| | | | non overloading of c-funcs.
* StringBuffer -> StringBuilderSven Gothel2013-07-142-3/+3
|
* gluegen: remove executable bit from java and c source filesHarvey Harrison2013-04-091-0/+0
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Revert "Minor revert of clone replacement w/ copt-ctor of commit ↵Sven Gothel2012-10-183-7/+4
| | | | | | | | | | | | | | | d7fb6a7bcfbd2d5ac452abdcdd31fb4d71441c70" This reverts commit 73e8828566404e864170688dfb4fd530a83f8add. Convinced after discussing semantics w/ Harvey Harrison: "the copy-constructor is way for predictable (as in branch-predictable) and has better cache behavior, it can issue almost all the writes in parallel, and has no exception catching. So, the copy-constructor actually ends up being more efficient, and you get typechecking to boot."
* Minor revert of clone replacement w/ copt-ctor of commit ↵Sven Gothel2012-10-173-4/+7
| | | | | | d7fb6a7bcfbd2d5ac452abdcdd31fb4d71441c70 clone of ArrayList is more shallow than it's clone operation (?)
* gluegen: generics annotations for various ArrayList/List useHarvey Harrison2012-10-154-5/+5
| | | | | | | - Use the copy constructor rather than ArrayList.clone() - constrain listsEqual so the compiler will warn about comparing lists of different types Signed-off-by: Harvey Harrison <[email protected]>
* Reducing Type's equalsSven Gothel2012-10-161-32/+0
|
* Intermediate revised Type.java edit before reducingSven Gothel2012-10-161-8/+34
|
* gluegen: conditional cleanup in Type.equals()Harvey Harrison2012-10-141-12/+7
| | | | | | | | - instanceof includes null checking - simplify comparison of name, either they are the same object (possibly null) or they compare equal as strings Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: break apart a complex conditional in Type.equals() for readabilityHarvey Harrison2012-10-131-2/+15
| | | | | | - move the cheap integer compares earlier before the String comparisons Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: fix equals comparison in cgrammer Type classHarvey Harrison2012-10-131-1/+1
| | | | | | | name was being compared to itself, rather than the name of the type we are comparing, looks like a simple typo. Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: remove trailing whitespace from cgrammer Type classHarvey Harrison2012-10-131-10/+10
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* StringBuffer -> StringBuilder (Local objects, no concurrency)Sven Gothel2012-04-167-30/+29
|
* Reversed Type relocation ; Minor fixSven Gothel2011-07-2124-4/+2372
| | | | | | | Reversed Type relocation (commit 92d6c9dc5fa72b01703456452c60822f36c14fff) from com.jogamp.gluegen.runtime.types back to com.jogamp.gluegen.cgram.types Enabled MemoryLayoutType.setLayouted(), avoiding double layout
* - Moved most types and StructLayout to runtime package:Sven Gothel2011-07-1820-2117/+8
| | | | | | | | | | | | | | | | | | | | | com.jogamp.gluegen.cgram.types -> com.jogamp.gluegen.runtime.types This is required for desired runtime memory layout. - Split CompoundType to StructType + UnionType - StructLayout: - Utilizing SizeThunk alignment - Alignment 1) Natural type alignment 2) Add Size 3) Trailing padding w/ largest element alignment - Only perform memory layout once for type. Status: - Unit test passes w/ static MachineDescriptor64Bit - FIXME static 32bit is faulty, uses 64bit size/alignment - TODO runtime struct layout to please all platforms w/o worrying
* GlueGen: Alignment Cleanup ..Sven Gothel2011-07-174-53/+104
| | | | | | | | | | - SizeThunk - rename: compute -> computeSize - add: computeAlignment - merge types: char -> int8, short -> int16 - 'int' and 'long' may differ -
* GlueGen proper size / alignment of primitive and compound types usage [1/2] ↵Sven Gothel2011-07-1710-178/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Preparation. Currently GlueGen fails for type long (size) and some alignments (see package.html). - The size and alignment values shall be queried at runtime. - Compound alignment needs to follow the described natural alignment (also @runtime). - - Build - add Linux Arm7 (EABI) - junit test - added compound/struct tests, pointing out the shortcomings of current impl. - package.html - Added alignment documentation - remove intptr.cfg - add GluGen types int8_t, int16_t, uint8_t, uint16_t - move MachineDescription* into runtime - Platform - has runtime MachineDescription - moved size, .. to MachineDescription - use enums for OSType, CPUArch and CPUType defined by os.name/os.arch, triggering exception if os/arch is not supported. This avoids Java String comparison and conscious os/arch detection. - MachineDescription: - compile time instances MachineDescription32Bits, MachineDescription64Bits - runtime queried instance MachineDescriptionRuntime - correct size, alignment, page size, ..
* Fix size_t, uintptr_t and uint32_t, uint64_t: suppress 'unsigned' in ↵Sven Gothel2010-11-142-5/+5
| | | | | | | 'toString()' ; Added type tests. For size_t and uintptr_t this actually generated invalid C code. Added type tests for those.
* Gluegen: Types (stddef/stdint), Header and Predefined Macro ChangeSven Gothel2010-11-094-0/+28
| | | | | | | | | | | | | Read API doc ad GlueGen.java New predefined types: wchar_t, intptr_t, uintptr_t New reusable headers for gluegen usage: make/stub_includes/gluegen for native usage: make/stub_includes/platform New predefined macro #define __GLUEGEN__ 2
* Clarified cgram license, ie TNode.javaSven Gothel2010-11-081-0/+38
|
* Renamed com.sun.gluegen -> com.jogamp.gluegenSven Gothel2010-11-0634-0/+8442