aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2022-04-25 19:09:12 -0500
committerMatt Strapp <matt@mattstrapp.net>2022-04-25 19:21:02 -0500
commit51247ec41133e04e0b0ee04cbf2e290ff26be03d (patch)
treebfca271e8365c624cc90695343530179a39e899c /src/util.cpp
parente (diff)
downloadcsci4211-master.tar
csci4211-master.tar.gz
csci4211-master.tar.bz2
csci4211-master.tar.lz
csci4211-master.tar.xz
csci4211-master.tar.zst
csci4211-master.zip
I give upHEADmaster
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to '')
-rw-r--r--src/util.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/util.cpp b/src/util.cpp
index dc95441..e6f0902 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1,11 +1,6 @@
-#include <cstddef>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <string>
-#include <sys/timeb.h>
-#include <time.h>
-
+// Author Name: Matt Strapp
+// Date: 25 April 2022
+// x500: strap012
#include "util.hpp"
#define VALID_CHARACTERS \
@@ -234,7 +229,7 @@ void Log(const char *format, ...) {
}
// convert buf[0:3] to int
-void buf2i(BYTE *buf, int &i) {
+void BigEndianToLittle(BYTE *buf, int &i) {
// No way to avoid Segmentation fault. Some bytes may be 0
i = 0;
i += buf[3];
@@ -244,7 +239,7 @@ void buf2i(BYTE *buf, int &i) {
}
// convert int to buf[4] where buf[0] contains MSB's and buf[3] contains LSB's
-void i2buf(int &i, BYTE *buf) {
+void LittleEndianToBig(int &i, BYTE *buf) {
// No way to avoid Segmentation fault. Some bytes may be 0
buf[0] = (BYTE)((i & 0xFF000000) >> 24);
buf[1] = (BYTE)((i & 0x00FF0000) >> 16);