mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
reverse order of nested array brackets to match C convention
This commit is contained in:
parent
a39a8f57c3
commit
33517c9c8d
@ -154,6 +154,22 @@ get_array_size() const {
|
|||||||
return _array_size;
|
return _array_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: DCArrayParameter::append_array_specification
|
||||||
|
// Access: Public, Virtual
|
||||||
|
// Description: Returns the type represented by this_type[size].
|
||||||
|
//
|
||||||
|
// In the case of a DCArrayParameter, this means it
|
||||||
|
// modifies the current type to append the array
|
||||||
|
// specification on the innermost type, and returns this
|
||||||
|
// same pointer again.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
DCParameter *DCArrayParameter::
|
||||||
|
append_array_specification(const DCUnsignedIntRange &size) {
|
||||||
|
_element_type = _element_type->append_array_specification(size);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: DCArrayParameter::calc_num_nested_fields
|
// Function: DCArrayParameter::calc_num_nested_fields
|
||||||
// Access: Public, Virtual
|
// Access: Public, Virtual
|
||||||
@ -223,7 +239,7 @@ output_instance(ostream &out, bool brief, const string &prename,
|
|||||||
strm << "]";
|
strm << "]";
|
||||||
|
|
||||||
_element_type->output_instance(out, brief, prename, name,
|
_element_type->output_instance(out, brief, prename, name,
|
||||||
strm.str() + postname);
|
postname + strm.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,8 @@ PUBLISHED:
|
|||||||
int get_array_size() const;
|
int get_array_size() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual DCParameter *append_array_specification(const DCUnsignedIntRange &size);
|
||||||
|
|
||||||
virtual int calc_num_nested_fields(size_t length_bytes) const;
|
virtual int calc_num_nested_fields(size_t length_bytes) const;
|
||||||
virtual DCPackerInterface *get_nested_field(int n) const;
|
virtual DCPackerInterface *get_nested_field(int n) const;
|
||||||
virtual bool validate_num_nested_fields(int num_nested_fields) const;
|
virtual bool validate_num_nested_fields(int num_nested_fields) const;
|
||||||
|
@ -17,11 +17,11 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "dcParameter.h"
|
#include "dcParameter.h"
|
||||||
|
#include "dcArrayParameter.h"
|
||||||
#include "hashGenerator.h"
|
#include "hashGenerator.h"
|
||||||
#include "dcindent.h"
|
#include "dcindent.h"
|
||||||
#include "dcTypedef.h"
|
#include "dcTypedef.h"
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: DCParameter::Constructor
|
// Function: DCParameter::Constructor
|
||||||
// Access: Protected
|
// Access: Protected
|
||||||
@ -180,6 +180,19 @@ set_typedef(const DCTypedef *dtypedef) {
|
|||||||
_typedef = dtypedef;
|
_typedef = dtypedef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: DCParameter::append_array_specification
|
||||||
|
// Access: Public, Virtual
|
||||||
|
// Description: Returns the type represented by this_type[size].
|
||||||
|
//
|
||||||
|
// In the case of a generic DCParameter, this means it
|
||||||
|
// returns a DCArrayParameter wrapped around this type.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
DCParameter *DCParameter::
|
||||||
|
append_array_specification(const DCUnsignedIntRange &size) {
|
||||||
|
return new DCArrayParameter(this, size);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: DCParameter::output
|
// Function: DCParameter::output
|
||||||
// Access: Public, Virtual
|
// Access: Public, Virtual
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "dcbase.h"
|
#include "dcbase.h"
|
||||||
#include "dcField.h"
|
#include "dcField.h"
|
||||||
|
#include "dcNumericRange.h"
|
||||||
|
|
||||||
class DCSimpleParameter;
|
class DCSimpleParameter;
|
||||||
class DCClassParameter;
|
class DCClassParameter;
|
||||||
@ -65,6 +66,7 @@ PUBLISHED:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void set_typedef(const DCTypedef *dtypedef);
|
void set_typedef(const DCTypedef *dtypedef);
|
||||||
|
virtual DCParameter *append_array_specification(const DCUnsignedIntRange &size);
|
||||||
|
|
||||||
virtual void output(ostream &out, bool brief) const;
|
virtual void output(ostream &out, bool brief) const;
|
||||||
virtual void write(ostream &out, bool brief, int indent_level) const;
|
virtual void write(ostream &out, bool brief, int indent_level) const;
|
||||||
|
@ -810,7 +810,7 @@ type_definition:
|
|||||||
if ($1 == (DCParameter *)NULL) {
|
if ($1 == (DCParameter *)NULL) {
|
||||||
$$ = NULL;
|
$$ = NULL;
|
||||||
} else {
|
} else {
|
||||||
$$ = new DCArrayParameter($1, uint_range);
|
$$ = $1->append_array_specification(uint_range);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
@ -853,7 +853,7 @@ parameter_definition:
|
|||||||
}
|
}
|
||||||
| parameter_definition '[' uint_range ']'
|
| parameter_definition '[' uint_range ']'
|
||||||
{
|
{
|
||||||
$$ = new DCArrayParameter($1, uint_range);
|
$$ = $1->append_array_specification(uint_range);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user