Revision: 54876
http://brlcad.svn.sourceforge.net/brlcad/?rev=54876&view=rev
Author: n_reed
Date: 2013-03-26 14:51:13 +0000 (Tue, 26 Mar 2013)
Log Message:
-----------
Facilitate merge work by removing the const_ typedef return types introducded
in r49683. It's not clear that returned values need const qualification, or
that they are assigned to lvalues that preserve that qualification, so these
const_ types are presently an elaborate way to accomplish nothing, and moreover
have caused issues parsing some express inputs. Until someone can
authoritatively determine what values should and should-not be considered
read-only, we'll take a much simpler approach to suppressing misued qualifier
warnings by just omitting the erroneous application of const to generated
return types.
Revision Links:
--------------
http://brlcad.svn.sourceforge.net/brlcad/?rev=49683&view=rev
Modified Paths:
--------------
brlcad/trunk/src/other/step/src/clstepcore/STEPaggregate.h
brlcad/trunk/src/other/step/src/fedex_plus/classes.c
brlcad/trunk/src/other/step/src/fedex_plus/classes_wrapper.cc
brlcad/trunk/src/other/step/src/fedex_plus/multpass.c
brlcad/trunk/src/other/step/src/fedex_plus/selects.c
Modified: brlcad/trunk/src/other/step/src/clstepcore/STEPaggregate.h
===================================================================
--- brlcad/trunk/src/other/step/src/clstepcore/STEPaggregate.h 2013-03-26
14:22:02 UTC (rev 54875)
+++ brlcad/trunk/src/other/step/src/clstepcore/STEPaggregate.h 2013-03-26
14:51:13 UTC (rev 54876)
@@ -32,8 +32,6 @@
typedef STEPaggregate * STEPaggregateH;
typedef STEPaggregate * STEPaggregate_ptr;
-typedef const STEPaggregate * const_STEPaggregateH;
-typedef const STEPaggregate * const_STEPaggregate_ptr;
typedef STEPaggregate_ptr STEPaggregate_var;
class SCL_CORE_EXPORT STEPaggregate : public SingleLinkList {
@@ -101,8 +99,6 @@
};
typedef GenericAggregate * GenericAggregateH;
typedef GenericAggregate * GenericAggregate_ptr;
-typedef const GenericAggregate * const_GenericAggregateH;
-typedef const GenericAggregate * const_GenericAggregate_ptr;
typedef GenericAggregate_ptr GenericAggregate_var;
/******************************************************************************
@@ -125,8 +121,6 @@
};
typedef EntityAggregate * EntityAggregateH;
typedef EntityAggregate * EntityAggregate_ptr;
-typedef const EntityAggregate * const_EntityAggregateH;
-typedef const EntityAggregate * const_EntityAggregate_ptr;
typedef EntityAggregate_ptr EntityAggregate_var;
/****************************************************************//**
@@ -149,8 +143,6 @@
};
typedef SelectAggregate * SelectAggregateH;
typedef SelectAggregate * SelectAggregate_ptr;
-typedef const SelectAggregate * const_SelectAggregateH;
-typedef const SelectAggregate * const_SelectAggregate_ptr;
typedef SelectAggregate_ptr SelectAggregate_var;
/****************************************************************//**
@@ -167,8 +159,6 @@
};
typedef StringAggregate * StringAggregateH;
typedef StringAggregate * StringAggregate_ptr;
-typedef const StringAggregate * const_StringAggregateH;
-typedef const StringAggregate * const_StringAggregate_ptr;
typedef StringAggregate_ptr StringAggregate_var;
@@ -186,8 +176,6 @@
};
typedef BinaryAggregate * BinaryAggregateH;
typedef BinaryAggregate * BinaryAggregate_ptr;
-typedef const BinaryAggregate * const_BinaryAggregateH;
-typedef const BinaryAggregate * const_BinaryAggregate_ptr;
typedef BinaryAggregate_ptr BinaryAggregate_var;
/**************************************************************//**
@@ -204,8 +192,6 @@
};
typedef EnumAggregate * EnumAggregateH;
typedef EnumAggregate * EnumAggregate_ptr;
-typedef const EnumAggregate * const_EnumAggregateH;
-typedef const EnumAggregate * const_EnumAggregate_ptr;
typedef EnumAggregate_ptr EnumAggregate_var;
class SCL_CORE_EXPORT LOGICALS : public EnumAggregate {
@@ -217,8 +203,6 @@
};
typedef LOGICALS * LogicalsH;
typedef LOGICALS * LOGICALS_ptr;
-typedef const LOGICALS * const_LogicalsH;
-typedef const LOGICALS * const_LOGICALS_ptr;
typedef LOGICALS_ptr LOGICALS_var;
SCL_CORE_EXPORT LOGICALS * create_LOGICALS();
@@ -232,7 +216,6 @@
};
typedef BOOLEANS * BOOLEANS_ptr;
-typedef const BOOLEANS * const_BOOLEANS_ptr;
typedef BOOLEANS_ptr BOOLEANS_var;
SCL_CORE_EXPORT BOOLEANS * create_BOOLEANS();
@@ -248,8 +231,6 @@
};
typedef RealAggregate * RealAggregateH;
typedef RealAggregate * RealAggregate_ptr;
-typedef const RealAggregate * const_RealAggregateH;
-typedef const RealAggregate * const_RealAggregate_ptr;
typedef RealAggregate_ptr RealAggregate_var;
class SCL_CORE_EXPORT IntAggregate : public STEPaggregate {
@@ -263,8 +244,6 @@
};
typedef IntAggregate * IntAggregateH;
typedef IntAggregate * IntAggregate_ptr;
-typedef const IntAggregate * const_IntAggregateH;
-typedef const IntAggregate * const_IntAggregate_ptr;
typedef IntAggregate_ptr IntAggregate_var;
///////////////////////////////////////////////////////////////////////////////
@@ -299,7 +278,6 @@
** This class is for the Nodes of GenericAggregates
******************************************************************/
typedef STEPnode * STEPnodeH;
-typedef const STEPnode * const_STEPnodeH;
class SCL_CORE_EXPORT GenericAggrNode : public STEPnode {
public:
SCLundefined value;
Modified: brlcad/trunk/src/other/step/src/fedex_plus/classes.c
===================================================================
--- brlcad/trunk/src/other/step/src/fedex_plus/classes.c 2013-03-26
14:22:02 UTC (rev 54875)
+++ brlcad/trunk/src/other/step/src/fedex_plus/classes.c 2013-03-26
14:51:13 UTC (rev 54876)
@@ -601,19 +601,6 @@
}
-int isReferenceType( Class_Of_Type class ) {
- if( ( class == string_ ) ||
- ( class == logical_ ) ||
- ( class == boolean_ ) ||
- ( class == real_ ) ||
- ( class == integer_ ) ||
- ( class == enumeration_ ) ) {
- return 0;
- }
-
- return 1;
-}
-
/**************************************************************//**
** Procedure: ATTRsign_access_method
** Parameters: const Variable a -- attribute to print
@@ -630,23 +617,14 @@
void ATTRsign_access_methods( Variable a, FILE * file ) {
Type t = VARget_type( a );
- Class_Of_Type class;
char ctype [BUFSIZ];
char attrnm [BUFSIZ];
generate_attribute_func_name( a, attrnm );
- class = TYPEget_type( t );
-
strncpy( ctype, AccessType( t ), BUFSIZ );
-
- if( isReferenceType( class ) ) {
- fprintf( file, " const_%s %s() const;\n", ctype, attrnm );
- } else {
- fprintf( file, " %s %s() const;\n", ctype, attrnm );
- }
+ fprintf( file, " %s %s() const;\n", ctype, attrnm );
fprintf( file, " void %s (const %s x);\n\n", attrnm, ctype );
-
return;
}
@@ -669,20 +647,15 @@
void ATTRprint_access_methods_get_head( const char * classnm, Variable a,
FILE * file ) {
Type t = VARget_type( a );
- Class_Of_Type class = TYPEget_type( t );
char ctype [BUFSIZ]; /* return type of the get function */
char funcnm [BUFSIZ]; /* name of member function */
generate_attribute_func_name( a, funcnm );
- strncpy( ctype, AccessType( t ), BUFSIZ );
+ /* ///////////////////////////////////////////////// */
- if( isReferenceType( class ) ) {
- fprintf( file, "\nconst_%s %s::%s() const ", ctype, classnm, funcnm );
- } else {
- fprintf( file, "\n%s %s::%s() const ", ctype, classnm, funcnm );
- }
-
+ strncpy( ctype, AccessType( t ), BUFSIZ );
+ fprintf( file, "\n%s %s::%s( ) const ", ctype, classnm, funcnm );
return;
}
@@ -2621,8 +2594,6 @@
fprintf( files->classes, "typedef %s * %sH;\n", n, n );
fprintf( files->classes, "typedef %s * %s_ptr;\n", n, n );
fprintf( files->classes, "typedef %s_ptr %s_var;\n", n, n );
- fprintf( files->classes, "typedef const %s * const_%sH;\n", n, n
);
- fprintf( files->classes, "typedef const %s * const_%s_ptr;\n", n,
n );
fprintf( files->classes, "#define %s__set SDAI_DAObject__set\n", n
);
fprintf( files->classes, "#define %s__set_var
SDAI_DAObject__set_var\n", n );
}
@@ -2750,7 +2721,6 @@
fprintf( inc, "};\n" );
fprintf( inc, "\ntypedef %s * %s_ptr;\n", n, n );
- fprintf( inc, "\ntypedef const %s * const_%s_ptr;\n", n, n );
/* Print ObjectStore Access Hook function */
@@ -2774,7 +2744,6 @@
fprintf( inc, "};\n" );
fprintf( inc, "\ntypedef %s_agg * %s_agg_ptr;\n", n, n );
- fprintf( inc, "\ntypedef const %s_agg * const_%s_agg_ptr;\n", n, n );
/* DAS brandnew below */
@@ -3062,12 +3031,8 @@
strncpy( nm, SelectName( TYPEget_name( t ) ), BUFSIZ );
fprintf( classes, "class %s;\n", nm );
fprintf( classes, "typedef %s * %s_ptr;\n", nm, nm );
- fprintf( classes, "typedef const %s * const_%s_ptr;\n", nm, nm );
fprintf( classes, "class %s_agg;\n", nm );
fprintf( classes, "typedef %s_agg * %s_agg_ptr;\n", nm, nm );
- fprintf( classes, "typedef const %s_agg * const_%s_agg_ptr;\n",
nm, nm );
- fprintf( classes, "typedef class %s_agg *
class_%s_agg_ptr;\n", nm, nm );
- fprintf( classes, "typedef const class %s_agg *
const_class_%s_agg_ptr;\n", nm, nm );
}
} else {
if( TYPEis_aggregate( t ) ) {
@@ -3089,10 +3054,8 @@
strncpy( nm, ClassName( TYPEget_name( t ) ), BUFSIZ );
fprintf( classes, "typedef %s %s;\n", TYPEget_ctype( t ),
nm );
if( TYPEis_aggregate( t ) ) {
- fprintf( classes, "typedef %s * %sH;\n", nm, nm );
- fprintf( classes, "typedef const %s * const_%sH;\n", nm, nm );
- fprintf( classes, "typedef %s * %s_ptr;\n", nm, nm
);
- fprintf( classes, "typedef const %s * const_%s_ptr;\n", nm, nm
);
+ fprintf( classes, "typedef %s * %sH;\n", nm, nm );
+ fprintf( classes, "typedef %s * %s_ptr;\n", nm, nm );
fprintf( classes, "typedef %s_ptr %s_var;\n", nm, nm );
}
}
@@ -3278,7 +3241,6 @@
printEnumCreateHdr( files->inc, type );
printEnumCreateBody( files->lib, type );
fprintf( files->inc, "typedef %s_agg * %s_agg_ptr;\n", nm,
nm );
- fprintf( files->inc, "typedef const %s_agg * const_%s_agg_ptr;\n", nm,
nm );
printEnumAggrCrHdr( files->inc, type );
printEnumAggrCrBody( files->lib, type );
return;
Modified: brlcad/trunk/src/other/step/src/fedex_plus/classes_wrapper.cc
===================================================================
--- brlcad/trunk/src/other/step/src/fedex_plus/classes_wrapper.cc
2013-03-26 14:22:02 UTC (rev 54875)
+++ brlcad/trunk/src/other/step/src/fedex_plus/classes_wrapper.cc
2013-03-26 14:51:13 UTC (rev 54876)
@@ -295,8 +295,7 @@
fprintf( files->inc, "\n};\n" );
- fprintf( files->inc, "\n\ntypedef SdaiModel_contents_%s *
SdaiModel_contents_%s_ptr;\n", SCHEMAget_name( schema ), SCHEMAget_name( schema
) );
- fprintf( files->inc, "\n\ntypedef const SdaiModel_contents_%s *
const_SdaiModel_contents_%s_ptr;\n", SCHEMAget_name( schema ), SCHEMAget_name(
schema ) );
+ fprintf( files->inc, "\n\ntypedef SdaiModel_contents_%s *
SdaiModel_contents_%s_ptr;\n", SCHEMAget_name( schema ), SCHEMAget_name( schema
) );
fprintf( files->inc, "typedef SdaiModel_contents_%s_ptr
SdaiModel_contents_%s_var;\n", SCHEMAget_name( schema ), SCHEMAget_name( schema
) );
fprintf( files -> inc,
Modified: brlcad/trunk/src/other/step/src/fedex_plus/multpass.c
===================================================================
--- brlcad/trunk/src/other/step/src/fedex_plus/multpass.c 2013-03-26
14:22:02 UTC (rev 54875)
+++ brlcad/trunk/src/other/step/src/fedex_plus/multpass.c 2013-03-26
14:51:13 UTC (rev 54876)
@@ -630,11 +630,9 @@
strncpy( nm, SelectName( TYPEget_name( t ) ), BUFSIZ - 1 );
strncpy( basenm, SelectName( TYPEget_name( i ) ), BUFSIZ - 1 );
fprintf( classes, "typedef %s %s;\n", basenm, nm );
- fprintf( classes, "typedef %s * %s_ptr;\n", nm, nm );
- fprintf( classes, "typedef const %s * const_%s_ptr;\n", nm, nm );
+ fprintf( classes, "typedef %s * %s_ptr;\n", nm, nm );
fprintf( classes, "typedef %s_agg %s_agg;\n", basenm, nm );
- fprintf( classes, "typedef %s_agg * %s_agg_ptr;\n",
nm, nm );
- fprintf( classes, "typedef const %s_agg * const_%s_agg_ptr;\n",
nm, nm );
+ fprintf( classes, "typedef %s_agg * %s_agg_ptr;\n", nm, nm );
}
}
SCOPEod
@@ -670,10 +668,8 @@
strncpy( nm, ClassName( TYPEget_name( t ) ), BUFSIZ );
fprintf( classes, "typedef %s %s;\n",
TYPEget_ctype( t ), nm );
- fprintf( classes, "typedef %s * %sH;\n", nm, nm );
- fprintf( classes, "typedef const %s * const_%sH;\n", nm, nm );
- fprintf( classes, "typedef %s * %s_ptr;\n", nm, nm );
- fprintf( classes, "typedef const %s * const_%s_ptr;\n", nm, nm );
+ fprintf( classes, "typedef %s * %sH;\n", nm, nm );
+ fprintf( classes, "typedef %s * %s_ptr;\n", nm, nm );
}
}
SCOPEod
Modified: brlcad/trunk/src/other/step/src/fedex_plus/selects.c
===================================================================
--- brlcad/trunk/src/other/step/src/fedex_plus/selects.c 2013-03-26
14:22:02 UTC (rev 54875)
+++ brlcad/trunk/src/other/step/src/fedex_plus/selects.c 2013-03-26
14:51:13 UTC (rev 54876)
@@ -759,8 +759,7 @@
fprintf( f, "\ninline SDAI_Select * create_%s () { return new %s; }\n", n,
n );
/* DAR - moved from SCOPEPrint() */
- fprintf( f, "typedef %s * %sH;\n", n, n );
- fprintf( f, "typedef const %s * const_%sH;\n", n, n );
+ fprintf( f, "typedef %s * %sH;\n", n, n );
fprintf( f, "typedef %s_ptr %s_var;\n\n", n, n );
/* print things for aggregate class */
@@ -1997,8 +1996,7 @@
}
strncpy( nm, SelectName( TYPEget_name( t ) ), BUFSIZ );
strncpy( tdnm, TYPEtd_name( t ), BUFSIZ );
- fprintf( inc, "typedef %s * %sH;\n", nm, nm );
- fprintf( inc, "typedef const %s * const_%sH;\n", nm, nm );
+ fprintf( inc, "typedef %s * %sH;\n", nm, nm );
fprintf( inc, "typedef %s_ptr * %s_var;\n", nm, nm );
/* Below are specialized create functions for the renamed sel type
(both
// single and aggregate). The functions call the original sel's con-
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game
on Steam. $5K grand prize plus 10 genre and skill prizes.
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits