User`s guide
Formatting Compiler-Generated Code
5-33
Modified Indentation
This example shows the same segment of code using a statement indentation
of two and an expression indentation of one.
mcc -F statement-indent:2 -F expression-indent:1 -x gasket
generates the following code segment.
012345678
12345678901234567890123456789012345678901234567890123456789012345678901234567890
void mlxGasket(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
mxArray * mprhs[1];
mxArray * mplhs[1];
int i;
if (nlhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: gasket Line: 1 Column: 1 The function \"gasket"
"\" was called with more than the declared number of outputs (1)."));
}
if (nrhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: gasket Line: 1 Column: 1 The function \"gaske"
"t\" was called with more than the declared number of inputs (1)."));
}
for (i = 0; i < 1; ++i) {
mplhs[i] = mclGetUninitializedArray();
}
for (i = 0; i < 1 && i < nrhs; ++i) {
mprhs[i] = prhs[i];
}
for (; i < 1; ++i) {
mprhs[i] = NULL;
}
mlfEnterNewContext(0, 1, mprhs[0]);
mplhs[0] = Mgasket(nlhs, mprhs[0]);
mlfRestorePreviousContext(0, 1, mprhs[0]);
plhs[0] = mplhs[0];
}