Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redeclaration of enums #30

Closed
bnovoselnik opened this issue Jun 21, 2018 · 2 comments
Closed

Redeclaration of enums #30

bnovoselnik opened this issue Jun 21, 2018 · 2 comments

Comments

@bnovoselnik
Copy link
Contributor

bnovoselnik commented Jun 21, 2018

There are three enums with the same fields in hpipm_x_ocp_qp_ipm.h, hpipm_x_dense_qp_ipm.h and hpipm_x_tree_ocp_qp_ipm.h:

enum ocp_qp_ipm_mode
	{
	SPEED_ABS, // focus on speed, absolute IPM formulation
	SPEED, // focus on speed, relative IPM formulation
	BALANCE, // balanced mode, relative IPM formulation
	ROBUST, // focus on robustness, relative IPM formulation
	};

enum dense_qp_ipm_mode
	{
	SPEED_ABS, // focus on speed, absolute IPM formulation
	SPEED, // focus on speed, relative IPM formulation
	BALANCE, // balanced mode, relative IPM formulation
	ROBUST, // focus on robustness, relative IPM formulation
	};

enum tree_ocp_qp_ipm_mode
	{
	SPEED_ABS, // focus on speed, absolute IPM formulation
	SPEED, // focus on speed, relative IPM formulation
	BALANCE, // balanced mode, relative IPM formulation
	ROBUST, // focus on robustness, relative IPM formulation
	};

This will create problems whenever both of these headers are included somewhere else (e.g. in ACADOS OCP QP C interface) - compiler will complain about redeclaration of enumerators.

Therefore, these enum fields should be given different names (e.g. OCP_SPEED_ABS, DENSE_SPEED_ABS, TREE_OCP_SPEED, etc.) or just use one enum for everything if the modes are the same in all modules.

@giaf
Copy link
Owner

giaf commented Jun 28, 2018

should be fixed with the commit
7dfadfe

@bnovoselnik
Copy link
Contributor Author

Great, I'll pull it once I get back from Croatia (i.e. next Monday, right now I don't have my laptop with me).

@giaf giaf closed this as completed Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants