Commit 069b836d authored by 's avatar
Browse files

Fixed bug in mapi stdflib function binop()

git-svn-id: file:///home/svn/mapi/trunk@904 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 84bb4d27
......@@ -41,7 +41,7 @@ static int binop_process_add(mapidflib_function_instance_t *instance,
MAPI_UNUSED mapid_pkthdr_t* pkt_head)
{
unsigned long long *res,*left,*right;
binop_inst_t *i=instance->internal_data;
binop_inst_t *i = (binop_inst_t *)instance->internal_data;
res=instance->result.data;
left=((mapidflib_result_t*)fhlp_get_res(i->left))->data;
......@@ -49,7 +49,6 @@ static int binop_process_add(mapidflib_function_instance_t *instance,
*res=*left+*right;
return 1;
}
static int binop_process_sub(mapidflib_function_instance_t *instance,
......@@ -60,14 +59,11 @@ static int binop_process_sub(mapidflib_function_instance_t *instance,
unsigned long long *res,*left,*right;
binop_inst_t *i=instance->internal_data;
res=instance->result.data;
res=instance->result.data;
left=((mapidflib_result_t*)fhlp_get_res(i->left))->data;
right=((mapidflib_result_t*)fhlp_get_res(i->right))->data;
*res=*left-*right;
// printf("%llu - %llu = %llu\n",*left,*right,*res);
*res=*left-*right;
return 1;
}
......@@ -75,7 +71,7 @@ static int binop_instance(mapidflib_function_instance_t *instance,
MAPI_UNUSED int fd,
MAPI_UNUSED mapidflib_flow_mod_t *flow_mod)
{
int type;
int type, flow1, function1, flow2, function2;
mapiFunctArg* fargs;
binop_inst_t *i=instance->internal_data=malloc(sizeof(binop_inst_t));
......@@ -83,8 +79,16 @@ static int binop_instance(mapidflib_function_instance_t *instance,
fargs=instance->args;
type = getargint(&fargs);
i->left= fhlp_get_function_instance(instance->hwinfo->gflist,getargint(&fargs),getargint(&fargs));
i->right=fhlp_get_function_instance(instance->hwinfo->gflist,getargint(&fargs),getargint(&fargs));
flow1 = getargint(&fargs);
function1 = getargint(&fargs);
flow2 = getargint(&fargs);
function2 = getargint(&fargs);
i->left= fhlp_get_function_instance(instance->hwinfo->gflist, flow1, function1);
i->right=fhlp_get_function_instance(instance->hwinfo->gflist, flow2, function2);
//i->left= fhlp_get_function_instance(instance->hwinfo->gflist,getargint(&fargs),getargint(&fargs));
//i->right=fhlp_get_function_instance(instance->hwinfo->gflist,getargint(&fargs),getargint(&fargs));
if(type==BINOP_SUB)
instance->def->process=binop_process_sub;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment