Skip to content

Commit

Permalink
fix: cast warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
divy9881 committed Jun 27, 2020
1 parent 4ff45f8 commit 269bbec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion casbin/model/Assertion.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ enum policy_op{
policy_add,
policy_remove
};
typedef enum policy_op policy_op;

// Assertion represents an expression in a section of the model.
// For example: r = sub, obj, act
Expand All @@ -17,7 +18,7 @@ class Assertion {
string value;
vector<string> tokens;
vector<vector<string>> policy;
RoleManager *rm;
RoleManager* rm;

void BuildIncrementalRoleLinks(RoleManager* rm, policy_op op, vector<vector<string>> rules);

Expand Down
10 changes: 5 additions & 5 deletions casbin/util/built_in_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ ReturnType KeyMatch2(Scope scope) {
break;
}
if(key1_arr[i] != key2_arr[i]){
int index1 = key2_arr[i].find("*");
int index2 = key2_arr[i].find(":");
int index1 = int(key2_arr[i].find("*"));
int index2 = int(key2_arr[i].find(":"));
if(index1 != string::npos){
if(index1==0){
res = true;
Expand Down Expand Up @@ -103,9 +103,9 @@ ReturnType KeyMatch3(Scope scope) {
break;
}
if(key1_arr[i] != key2_arr[i]){
int index1 = key2_arr[i].find("*");
int index2 = key2_arr[i].find("{");
int index3 = key2_arr[i].find("}");
int index1 = int(key2_arr[i].find("*"));
int index2 = int(key2_arr[i].find("{"));
int index3 = int(key2_arr[i].find("}"));
if(index1 != string::npos){
if(index1==0){
res = true;
Expand Down

0 comments on commit 269bbec

Please sign in to comment.