Skip to content

Commit

Permalink
Returning from non-void methods as its undefined behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanmunawar committed Jul 23, 2021
1 parent 5b430aa commit cc2baad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion ambf_framework/afFramework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ template<>
///
btTransform afCartesianController::computeOutput<btTransform, btTransform>(const btTransform &process_val, const btTransform &set_point, const double &dt, const double &tsf){
// Not implemented yet
return btTransform();
}


Expand Down Expand Up @@ -887,6 +888,8 @@ string afIdentification::getTypeAsStr(){
return "WORLD";
break;
default:
cerr << "ERROR! SHOULD NOT HAPPEN" << endl;
return "";
break;
}
}
Expand Down Expand Up @@ -9704,7 +9707,7 @@ void afVolume::fetchCommands(double dt)
///
cShaderProgramPtr afVolume::getShaderProgram()
{

return m_voxelObject->getShaderProgram();
}

///
Expand Down
4 changes: 2 additions & 2 deletions ambf_plugins/simulator_example/simulator_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using namespace std;
using namespace ambf;

class afTestSimulatorPlugin: public afSimulatorPlugin{
virtual void init(int argc, char** argv){}
virtual int init(int argc, char** argv){return 1;}
virtual void keyboardUpdate(GLFWwindow* a_window, int a_key, int a_scancode, int a_action, int a_mods){
cerr << "KEYBOARD INPUT RECEIVED FOR SIMULATION PLUGIN" << a_key << endl;
}
Expand All @@ -14,7 +14,7 @@ class afTestSimulatorPlugin: public afSimulatorPlugin{
virtual void graphicsUpdate(const afWorldPtr a_afWorld){}
virtual void physicsUpdate(const afWorldPtr a_afWorld){}
virtual void reset(){}
virtual bool close(){}
virtual bool close(){return 0;}
};


Expand Down
3 changes: 2 additions & 1 deletion ambf_plugins/volumetric_drilling/volumetric_drilling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ int afVolmetricDrillingPlugin::init(int argc, char **argv, const afWorldPtr a_af
// object->setRenderingModeBasic();
g_volObject->setRenderingModeIsosurfaceColors();
// object->setRenderingModeIsosurfaceMaterial();
return 1;
}

void afVolmetricDrillingPlugin::keyboardUpdate(GLFWwindow *a_window, int a_key, int a_scancode, int a_action, int a_mods){
Expand Down Expand Up @@ -131,5 +132,5 @@ void afVolmetricDrillingPlugin::reset(){

bool afVolmetricDrillingPlugin::close()
{

return 0;
}
4 changes: 2 additions & 2 deletions ambf_plugins/world_example/world_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using namespace ambf;

class afTestWorldPlugin: public afWorldPlugin{
virtual int init(const afWorldPtr a_afWorld, const afWorldAttribsPtr a_worldAttribs){}
virtual int init(const afWorldPtr a_afWorld, const afWorldAttribsPtr a_worldAttribs){return 1;}
virtual void graphicsUpdate(){}
virtual void physicsUpdate(const afWorldPtr a_afWorld){
std::cerr << "UPDATE FROM PLUGIN CALLED" << std::endl;
Expand All @@ -15,7 +15,7 @@ class afTestWorldPlugin: public afWorldPlugin{
}
}
virtual void reset(){}
virtual bool close(){}
virtual bool close(){return 0;}
};


Expand Down

0 comments on commit cc2baad

Please sign in to comment.