RagePhoto: replace strncmp with memcmp
RagePhoto(A): fix header spelling mistake RagePhotoA: update header description
This commit is contained in:
parent
d75eba2a46
commit
4ca8ac9297
3 changed files with 8 additions and 8 deletions
|
@ -352,7 +352,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra
|
||||||
rp_data->error = Error::IncompleteJpegMarker; // 12
|
rp_data->error = Error::IncompleteJpegMarker; // 12
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (strncmp(markerBuffer, "JPEG", 4) != 0) {
|
if (std::memcmp(markerBuffer, "JPEG", 4) != 0) {
|
||||||
rp_data->error = Error::IncorrectJpegMarker; // 13
|
rp_data->error = Error::IncorrectJpegMarker; // 13
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -398,7 +398,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra
|
||||||
rp_data->error = Error::IncompleteJsonMarker; // 18
|
rp_data->error = Error::IncompleteJsonMarker; // 18
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (strncmp(markerBuffer, "JSON", 4) != 0) {
|
if (std::memcmp(markerBuffer, "JSON", 4) != 0) {
|
||||||
rp_data->error = Error::IncorrectJsonMarker; // 19
|
rp_data->error = Error::IncorrectJsonMarker; // 19
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra
|
||||||
rp_data->error = Error::IncompleteTitleMarker; // 23
|
rp_data->error = Error::IncompleteTitleMarker; // 23
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (strncmp(markerBuffer, "TITL", 4) != 0) {
|
if (std::memcmp(markerBuffer, "TITL", 4) != 0) {
|
||||||
rp_data->error = Error::IncorrectTitleMarker; // 24
|
rp_data->error = Error::IncorrectTitleMarker; // 24
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -468,7 +468,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra
|
||||||
rp_data->error = Error::IncompleteDescMarker; // 28
|
rp_data->error = Error::IncompleteDescMarker; // 28
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (strncmp(markerBuffer, "DESC", 4) != 0) {
|
if (std::memcmp(markerBuffer, "DESC", 4) != 0) {
|
||||||
rp_data->error = Error::IncorrectDescMarker; // 29
|
rp_data->error = Error::IncorrectDescMarker; // 29
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -503,7 +503,7 @@ bool RagePhoto::load(const char *data, size_t length, RagePhotoData *rp_data, Ra
|
||||||
rp_data->error = Error::IncompleteJendMarker; // 33
|
rp_data->error = Error::IncompleteJendMarker; // 33
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (strncmp(markerBuffer, "JEND", 4) != 0) {
|
if (std::memcmp(markerBuffer, "JEND", 4) != 0) {
|
||||||
rp_data->error = Error::IncorrectJendMarker; // 34
|
rp_data->error = Error::IncorrectJendMarker; // 34
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
* \brief ABI Stable Wrapper for RagePhoto.
|
* \brief ABI Stable Wrapper for RagePhoto.
|
||||||
*
|
*
|
||||||
* Using RagePhotoA instead of RagePhoto allows your library or application to survive more changes in the RagePhoto class,
|
* Using RagePhotoA instead of RagePhoto allows your library or application to survive more changes in the RagePhoto class,
|
||||||
* disadvantages include worse performance, which should be pretty minimal, and not always include the newest features.
|
* disadvantages include that it doesn't always include the newest features, performance is about the same.
|
||||||
*/
|
*/
|
||||||
class RagePhotoA
|
class RagePhotoA
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue