Skip to content

Commit a244963

Browse files
fix call_c_auto with no input param
1 parent 39fd492 commit a244963

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/PHPtoCExt/Converter/CFunctionAutoConverter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ public function convert()
3030
if ($lineCompsCount == 1) { //this means we do not have return result variable
3131
$inputParamsStr = trim($lineComps[0]);
3232
if (strlen($inputParamsStr) == 0) {
33-
$this->searchAndReplace($filteredCodeLine,"call_c_function(\"$className.c\",\"$methodPureName\");");
33+
$this->searchAndReplace("call_c_auto();","call_c_function(\"$className.c\",\"$methodPureName\");");
3434
} else {
3535
$this->searchAndReplace($codeLine,"call_c_function(\"$className.c\",\"$methodPureName\",$inputParamsStr);");
3636
}
37-
} else if ($lineCompsCount == 2){ //this means we have input return result variable
37+
} else if ($lineCompsCount == 2){ //this means we have input return result variable
3838
$returnVarStr = $lineComps[0];
39-
$inputParamsStr = $lineComps[1];
39+
$inputParamsStr = trim($lineComps[1]);
4040
if (strlen($inputParamsStr) == 0) {
41-
$this->searchAndReplace($filteredCodeLine,"$returnVarStr = call_c_function(\"$className.c\",\"$methodPureName\");");
41+
$this->searchAndReplace($filteredCodeLine."call_c_auto();","$returnVarStr = call_c_function(\"$className.c\",\"$methodPureName\");");
4242
} else {
4343
$this->searchAndReplace($codeLine,"$returnVarStr = call_c_function(\"$className.c\",\"$methodPureName\",$inputParamsStr);");
4444
}

0 commit comments

Comments
 (0)