Skip to content

Commit

Permalink
Trivial documentation and comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainer Canavan committed Mar 2, 2016
1 parent a711441 commit 59e63a3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Expand Up @@ -3,5 +3,5 @@ To build and install the SHMT run:
./configure
make

And finally installing it by:
And finally install it via:
make install
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -25,9 +25,11 @@ SHMT:
## Limitations

* Supported maximum number of data array elements is
2^26 (67.108.864 on x32 systems) and 2^31 (2.147.483.648
on x64 systems).
2^26 (67,108,864 on 32 bit systems) and 2^31 (2,147,483,648
on 64 bit systems).
* The data array keys and values are always cast to string.
* Data files cannot be exchanged between 32 bit and 64 bit
systems or systems with different endianness.


## PHP Class
Expand All @@ -36,7 +38,7 @@ SHMT:
public static boolean SHMT::create(string $filename, array $array)
```

* Creates a SHMT from the `$array` and writes it into the `$filename`
* Creates a SHMT from the `$array` and writes it into the file `$filename`
* Returns `true` on success
* Throws exceptions on errors

Expand Down
4 changes: 2 additions & 2 deletions shmt.c
Expand Up @@ -49,7 +49,7 @@ int shmtWriteItem(struct _shmtCreatorItem *src, struct _shmtItem *shmtItem, FILE
shmtItem->val_len = src->val_len;

if (src->key_len) {
/* Check the site_t overflow */
/* Check for site_t overflow */
if ((shmtItem->key_pos + shmtItem->key_len) < shmtItem->key_pos) {
return 0;
} else if (fwrite(src->key, 1, src->key_len, file) != (size_t)src->key_len) {
Expand All @@ -58,7 +58,7 @@ int shmtWriteItem(struct _shmtCreatorItem *src, struct _shmtItem *shmtItem, FILE
}

if (src->val_len) {
/* Check the site_t overflow */
/* Check for site_t overflow */
if ((shmtItem->key_pos + shmtItem->key_len + shmtItem->val_len) <= shmtItem->key_pos) {
return 0;
} else if (fwrite(src->val, 1, src->val_len, file) != (size_t)src->val_len) {
Expand Down
2 changes: 1 addition & 1 deletion shmt.h
Expand Up @@ -53,7 +53,7 @@
{
uint32_t mark; /* The plausibility check mark */
uint16_t version; /* The file compatibility check mark */
uint8_t system; /* The system compatibility check mark (x32/x64) */
uint8_t system; /* The system compatibility check mark (32/64 bit) */
uint32_t mask; /* The hash map mask */
size_t mapSize; /* The total hash map table size */
size_t hashSize; /* The size of the "hash" part in the hash map */
Expand Down

0 comments on commit 59e63a3

Please sign in to comment.