Skip to content

Commit

Permalink
Updated file_id and hash, added const to related parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
ax-6 committed Aug 1, 2024
1 parent b2d3cec commit e4e3b1b
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion aqvm/base/file/file_id/file_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ int AqvmBaseFileFileId_GetFileId(const char* filename,
return 0;
}

uint32_t AqvmBaseFileFileId_GetFileIdHash(AqvmBaseFileFileId_FileId* file_id) {
uint32_t AqvmBaseFileFileId_GetFileIdHash(
const AqvmBaseFileFileId_FileId* file_id) {
if (file_id == NULL) {
// TODO
return 0;
Expand Down
2 changes: 1 addition & 1 deletion aqvm/base/file/file_id/file_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ typedef void AqvmBaseFileFileId_FileId;
int AqvmBaseFileFileId_GetFileId(const char* filename,
AqvmBaseFileFileId_FileId* file_id);

uint32_t AqvmBaseFileFileId_GetFileIdHash(AqvmBaseFileFileId_FileId* file_id);
uint32_t AqvmBaseFileFileId_GetFileIdHash(const AqvmBaseFileFileId_FileId* file_id);

#endif
2 changes: 1 addition & 1 deletion aqvm/base/file/file_id/unix/file_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int AqvmBaseFileFileIdUnix_GetFileId(const char* filename,
}

uint32_t AqvmBaseFileFileIdUnix_GetFileIdHash(
AqvmBaseFileFileIdUnix_FileId* file_id) {
const AqvmBaseFileFileIdUnix_FileId* file_id) {
if (file_id == NULL) {
// TODO
return 0;
Expand Down
3 changes: 1 addition & 2 deletions aqvm/base/file/file_id/unix/file_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#define AQVM_BASE_FILE_FILE_ID_UNIX_FILE_ID_H_

#include <stdint.h>

#include <sys/stat.h>
#include <sys/types.h>

Expand All @@ -22,7 +21,7 @@ int AqvmBaseFileFileIdUnix_GetFileId(const char* filename,
AqvmBaseFileFileIdUnix_FileId* file_id);

uint32_t AqvmBaseFileFileIdUnix_GetFileIdHash(
AqvmBaseFileFileIdUnix_FileId* file_id);
const AqvmBaseFileFileIdUnix_FileId* file_id);

#endif

Expand Down
2 changes: 1 addition & 1 deletion aqvm/base/file/file_id/windows/file_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int AqvmBaseFileFileIdWindows_GetFileId(
}

uint32_t AqvmBaseFileFileIdWindows_GetFileIdHash(
AqvmBaseFileFileIdWindows_FileId* file_id) {
const AqvmBaseFileFileIdWindows_FileId* file_id) {
if (file_id == NULL) {
// TODO
return 0;
Expand Down
2 changes: 1 addition & 1 deletion aqvm/base/file/file_id/windows/file_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int AqvmBaseFileFileIdWindows_GetFileId(
const char* filename, AqvmBaseFileFileIdWindows_FileId* file_id);

uint32_t AqvmBaseFileFileIdWindows_GetFileIdHash(
AqvmBaseFileFileIdWindows_FileId* file_id);
const AqvmBaseFileFileIdWindows_FileId* file_id);

#endif
#endif
2 changes: 1 addition & 1 deletion aqvm/base/hash/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ uint32_t AqvmBaseHash_HashString(const char* str) {
return hash;
}

uint32_t AqvmBaseHash_HashUnsignedIntArray(uint32_t* data, size_t size) {
uint32_t AqvmBaseHash_HashUnsignedIntArray(const uint32_t* data, size_t size) {
if (data == NULL) {
// TODO
return 0;
Expand Down
2 changes: 1 addition & 1 deletion aqvm/base/hash/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ int AqvmBaseHash_Hash(int data);

uint32_t AqvmBaseHash_HashString(const char* str);

uint32_t AqvmBaseHash_HashUnsignedIntArray(uint32_t* data, size_t size);
uint32_t AqvmBaseHash_HashUnsignedIntArray(const uint32_t* data, size_t size);

#endif

0 comments on commit e4e3b1b

Please sign in to comment.