-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finished ex1 ;) #4
base: master
Are you sure you want to change the base?
Conversation
@@ -1,38 +1,38 @@ | |||
# Prerequisites |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change CR/LF - it creates unrequired diff
@@ -0,0 +1,40 @@ | |||
#include "ErrorCode.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove documentation from C file (C15)
* @param[in] code the error code. | ||
* @return whether the error code indicates a success or not. | ||
*/ | ||
bool error_isSuccess(ErrorCode code) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameters are not constants (C2)
* @return whether the error code indicates a success or not. | ||
*/ | ||
bool error_isSuccess(ErrorCode code) { | ||
if (code == ERROR_SUCCESS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return code == ERROR_SUCCESS
* @return const char* the textual representation of the error code. | ||
*/ | ||
const char *error_getErrorMessage(ErrorCode code) { | ||
switch (code) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bloated code (C11)
mat->values[i] = (double *)calloc(width, sizeof(double)); | ||
if (mat->values[i] == NULL) { | ||
for (int j = 0; j < i; j++) { | ||
free(mat->values[j]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
B1
free(mat); | ||
return ERROR_ALLOCATION_FAILED; | ||
} | ||
for (int i = 0; i < mat->height; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Postfix increment (C5)
return ERROR_NULL; | ||
} | ||
|
||
uint32_t h = source->height, w = source->width; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h
and w
are generally not very good nor indicative names for variables
if (matrix == NULL) { | ||
return ERROR_NULL; | ||
} | ||
int row = (int)rowIndex, col = (int)colIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad cast (S9)
@@ -0,0 +1,113 @@ | |||
#pragma once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shared resources not in master (G7)
No description provided.