]> OCCT Git - occt-wok.git/commitdiff
0024165: Eliminate compiler warnings on unused variables in files generated by WOK...
authorabv <abv@opencascade.com>
Thu, 12 Sep 2013 06:57:03 +0000 (10:57 +0400)
committerbugmaster <bugmaster@opencascade.com>
Mon, 16 Sep 2013 12:33:41 +0000 (16:33 +0400)
A dummy cast to void is applied to potentially unused parameters and variables in generated Schema classes, to prevent compiler warnings on unused vars.

src/CSFDBSchema/CSFDBSchema_Template.edl

index 5a6497d2b74bd0173a74e73996141edcdaffbf14..a3e17f3fc241f7b2d60d8bd20689a7680bb990f1 100755 (executable)
@@ -205,6 +205,7 @@ $}
 $
 $void %Schema_%Type::SWrite(const %Type& pp, Storage_BaseDriver& f, const Handle(Storage_Schema)& theSchema)
 ${
+$  (void)pp; (void)theSchema; // dummy to avoid compiler warning on unused arg
 $  f.BeginWriteObjectData();
 $%Body
 $  f.EndWriteObjectData();
@@ -219,6 +220,8 @@ ${
 $  if (!p.IsNull()) {
 $    Handle(%Type) &pp = (Handle(%Type)&)p;
 $    theSchema->WritePersistentObjectHeader(p,f);
+$
+$    (void)pp; // dummy to avoid compiler warning on unused arg
 $    
 $    f.BeginWritePersistentObjectData();
 $%Body
@@ -258,6 +261,7 @@ $}
 $
 $void %Schema_%Type::SRead(%Type& pp, Storage_BaseDriver& f, const Handle(Storage_Schema)& theSchema)
 ${
+$  (void)pp; (void)theSchema; // dummy to avoid compiler warning on unused arg
 $  f.BeginReadObjectData();
 $%Body
 $  f.EndReadObjectData();
@@ -271,6 +275,8 @@ ${
 $  if (!p.IsNull()) {
 $    Handle(%Type) &pp = (Handle(%Type)&)p;
 $
+$    (void)pp; // dummy to avoid compiler warning on unused arg
+$
 $    theSchema->ReadPersistentObjectHeader(f);
 $    f.BeginReadPersistentObjectData();
 $%Body
@@ -366,11 +372,11 @@ $  }
 $
 $void %Schema_%Type::SWrite(const %Type& pp, Storage_BaseDriver& f, const Handle(Storage_Schema)& theSchema)
 ${
-$  Standard_Integer i;
+$  (void)theSchema; // dummy to avoid compiler warning on unused arg
 $
 $  f.BeginWriteObjectData();
 $  f.PutInteger(pp.Length());
-$  for (i = 0; i < pp.Length(); i++) {
+$  for (Standard_Integer i = 0; i < pp.Length(); i++) {
 $%Body
 $  }
 $  f.EndWriteObjectData();
@@ -381,6 +387,7 @@ $}
 $
 $void %Schema_%Type::SRead(%Type& pp, Storage_BaseDriver& f, const Handle(Storage_Schema)& theSchema)
 ${
+$  (void)theSchema; // dummy to avoid compiler warning on unused arg
 $  Standard_Integer size = 0;
 $
 $  f.BeginReadObjectData();