Skip to content

Commit

Permalink
Remove redundant commented-out switch-case blocks
Browse files Browse the repository at this point in the history
The commented-out switch-case blocks in the `matlabCreateNumericMatrixReal`
and `matlabCreateNumericArrayReal` functions have been removed. These blocks
were previously used to convert `AppExtensionClassId` to `mxClassID`, but
this functionality is now encapsulated in the `AppExtensionClassIdToMxClassId`
function. The removal of these comments helps to clean up the code and
improve readability.
  • Loading branch information
ptahmose committed Oct 6, 2024
1 parent 428b38d commit 792f4bb
Showing 1 changed file with 0 additions and 74 deletions.
74 changes: 0 additions & 74 deletions MatlabMex/app_api_implementation.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,43 +175,6 @@ mxClassID AppExtensionClassIdToMxClassId(enum AppExtensionClassId class_id)
Parameter* matlabCreateNumericMatrixReal(size_t m, size_t n, enum AppExtensionClassId class_id)
{
mxClassID mx_class_id = AppExtensionClassIdToMxClassId(class_id);
//switch (class_id)
//{
//case AppExtensionClassId_Uint8:
// mx_class_id = mxUINT8_CLASS;
// break;
//case AppExtensionClassId_Int8:
// mx_class_id = mxINT8_CLASS;
// break;
//case AppExtensionClassId_Uint16:
// mx_class_id = mxUINT16_CLASS;
// break;
//case AppExtensionClassId_Int16:
// mx_class_id = mxINT16_CLASS;
// break;
//case AppExtensionClassId_Uint32:
// mx_class_id = mxUINT32_CLASS;
// break;
//case AppExtensionClassId_Int32:
// mx_class_id = mxINT32_CLASS;
// break;
//case AppExtensionClassId_Uint64:
// mx_class_id = mxUINT64_CLASS;
// break;
//case AppExtensionClassId_Int64:
// mx_class_id = mxINT64_CLASS;
// break;
//case AppExtensionClassId_Double:
// mx_class_id = mxDOUBLE_CLASS;
// break;
//case AppExtensionClassId_Single:
// mx_class_id = mxSINGLE_CLASS;
// break;
//default:
// mx_class_id = mxUNKNOWN_CLASS;
// break;
//}

return (Parameter*)mxCreateNumericMatrix(m, n, mx_class_id, mxREAL);
}

Expand Down Expand Up @@ -279,43 +242,6 @@ Parameter* matlabGetField(const Parameter* parameter, const char* field_name)
Parameter* matlabCreateNumericArrayReal(size_t ndim, const size_t* dims, enum AppExtensionClassId class_id)
{
mxClassID mx_class_id = AppExtensionClassIdToMxClassId(class_id);
/*switch (class_id)
{
case AppExtensionClassId_Uint8:
mx_class_id = mxUINT8_CLASS;
break;
case AppExtensionClassId_Int8:
mx_class_id = mxINT8_CLASS;
break;
case AppExtensionClassId_Uint16:
mx_class_id = mxUINT16_CLASS;
break;
case AppExtensionClassId_Int16:
mx_class_id = mxINT16_CLASS;
break;
case AppExtensionClassId_Uint32:
mx_class_id = mxUINT32_CLASS;
break;
case AppExtensionClassId_Int32:
mx_class_id = mxINT32_CLASS;
break;
case AppExtensionClassId_Uint64:
mx_class_id = mxUINT64_CLASS;
break;
case AppExtensionClassId_Int64:
mx_class_id = mxINT64_CLASS;
break;
case AppExtensionClassId_Double:
mx_class_id = mxDOUBLE_CLASS;
break;
case AppExtensionClassId_Single:
mx_class_id = mxSINGLE_CLASS;
break;
default:
mx_class_id = mxUNKNOWN_CLASS;
break;
}*/

return (Parameter*)mxCreateNumericArray(ndim, dims, mx_class_id, mxREAL);
}

Expand Down

0 comments on commit 792f4bb

Please sign in to comment.