From: abv Date: Thu, 12 Sep 2013 06:57:03 +0000 (+0400) Subject: 0024165: Eliminate compiler warnings on unused variables in files generated by WOK... X-Git-Tag: V6_7_1~37 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=d9ce095a3a8dd16352fd67bbb22411d3c006f81a;p=occt-wok.git 0024165: Eliminate compiler warnings on unused variables in files generated by WOK (Schema) A dummy cast to void is applied to potentially unused parameters and variables in generated Schema classes, to prevent compiler warnings on unused vars. --- diff --git a/src/CSFDBSchema/CSFDBSchema_Template.edl b/src/CSFDBSchema/CSFDBSchema_Template.edl index 5a6497d..a3e17f3 100755 --- a/src/CSFDBSchema/CSFDBSchema_Template.edl +++ b/src/CSFDBSchema/CSFDBSchema_Template.edl @@ -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();