From 7fd29eb693db887545ef0b44eda6504f57701511 Mon Sep 17 00:00:00 2001 From: Victor Fernandes Date: Tue, 31 Jan 2017 08:31:36 -0500 Subject: [PATCH] Mathematical fixes --- INSTRUCTIONS.txt | 12 ++++++++++ MPTFAssignment1_F16/ass1ai.out | 41 --------------------------------- MPTFAssignment1_F16/ass1e.out | 25 -------------------- MPTFAssignment1_F16/ass1fi.out | 33 -------------------------- MPTFAssignment1_F16/ass1mi.out | 41 --------------------------------- buffer.c | 4 ++-- platy_gnu | Bin 14428 -> 14428 bytes test/ass1ai_test.out | 2 ++ 8 files changed, 16 insertions(+), 142 deletions(-) create mode 100644 INSTRUCTIONS.txt delete mode 100755 MPTFAssignment1_F16/ass1ai.out delete mode 100755 MPTFAssignment1_F16/ass1e.out delete mode 100755 MPTFAssignment1_F16/ass1fi.out delete mode 100755 MPTFAssignment1_F16/ass1mi.out diff --git a/INSTRUCTIONS.txt b/INSTRUCTIONS.txt new file mode 100644 index 0000000..c656346 --- /dev/null +++ b/INSTRUCTIONS.txt @@ -0,0 +1,12 @@ +To compile this under Linux: + +gcc -o platy_gnu buffer.c buffer.h platy_bt.c -Wall -ansi -pedantic + +To use: +./platy_gnu ass1.pls [f|a|m] + +f: fixed increment mode +a: additive increment mode +m: multiplicative mode + +NOTE: Change buffer.h to use malloc.h instead of mm_maloc.h if running on anything that isn't macOS \ No newline at end of file diff --git a/MPTFAssignment1_F16/ass1ai.out b/MPTFAssignment1_F16/ass1ai.out deleted file mode 100755 index c4c0841..0000000 --- a/MPTFAssignment1_F16/ass1ai.out +++ /dev/null @@ -1,41 +0,0 @@ -Reading file ass1.pls ....Please wait - -Printing buffer parameters: - -The capacity of the buffer is: 320 -The current size of the buffer is: 319 -The operational mode of the buffer is: 1 -The increment factor of the buffer is: 15 -The current mark of the buffer is: 319 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all computer users to -ignore the machine-dependent details of machine language. -Isn't that nice? =:) - -CST8152 -Autumn, 2016 - -Printing buffer parameters: - -The capacity of the buffer is: 320 -The current size of the buffer is: 320 -The operational mode of the buffer is: 1 -The increment factor of the buffer is: 15 -The current mark of the buffer is: 319 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all computer users to -ignore the machine-dependent details of machine language. -Isn't that nice? =:) - -CST8152 -Autumn, 2016˙ diff --git a/MPTFAssignment1_F16/ass1e.out b/MPTFAssignment1_F16/ass1e.out deleted file mode 100755 index e7b9d4e..0000000 --- a/MPTFAssignment1_F16/ass1e.out +++ /dev/null @@ -1,25 +0,0 @@ -Reading file ass1e.pls ....Please wait - -Printing buffer parameters: - -The capacity of the buffer is: 200 -The current size of the buffer is: 0 -The operational mode of the buffer is: 0 -The increment factor of the buffer is: 0 -The current mark of the buffer is: 0 - -Printing buffer contents: - -The buffer is empty. - -Printing buffer parameters: - -The capacity of the buffer is: 1 -The current size of the buffer is: 1 -The operational mode of the buffer is: 0 -The increment factor of the buffer is: 0 -The current mark of the buffer is: 0 - -Printing buffer contents: - -˙ diff --git a/MPTFAssignment1_F16/ass1fi.out b/MPTFAssignment1_F16/ass1fi.out deleted file mode 100755 index 7d97ee4..0000000 --- a/MPTFAssignment1_F16/ass1fi.out +++ /dev/null @@ -1,33 +0,0 @@ -Reading file ass1.pls ....Please wait -The input file ass1.pls is not completely loaded. -Input file size: 327 - -Printing buffer parameters: - -The capacity of the buffer is: 200 -The current size of the buffer is: 200 -The operational mode of the buffer is: 0 -The increment factor of the buffer is: 0 -The current mark of the buffer is: 200 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all compu - -Printing buffer parameters: - -The capacity of the buffer is: 201 -The current size of the buffer is: 201 -The operational mode of the buffer is: 0 -The increment factor of the buffer is: 0 -The current mark of the buffer is: 200 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all compu˙ diff --git a/MPTFAssignment1_F16/ass1mi.out b/MPTFAssignment1_F16/ass1mi.out deleted file mode 100755 index 9c4ae3b..0000000 --- a/MPTFAssignment1_F16/ass1mi.out +++ /dev/null @@ -1,41 +0,0 @@ -Reading file ass1.pls ....Please wait - -Printing buffer parameters: - -The capacity of the buffer is: 5085 -The current size of the buffer is: 319 -The operational mode of the buffer is: -1 -The increment factor of the buffer is: 15 -The current mark of the buffer is: 319 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all computer users to -ignore the machine-dependent details of machine language. -Isn't that nice? =:) - -CST8152 -Autumn, 2016 - -Printing buffer parameters: - -The capacity of the buffer is: 320 -The current size of the buffer is: 320 -The operational mode of the buffer is: -1 -The increment factor of the buffer is: 15 -The current mark of the buffer is: 319 - -Printing buffer contents: - -Compilers are fundamental to modern computing. -They act as translators, transforming human-oriented -language into computer-oriented machine-language. -A compiler allows virtually all computer users to -ignore the machine-dependent details of machine language. -Isn't that nice? =:) - -CST8152 -Autumn, 2016˙ diff --git a/buffer.c b/buffer.c index 17b95ef..66cf657 100644 --- a/buffer.c +++ b/buffer.c @@ -239,7 +239,7 @@ short b_setmark(Buffer* const pBD, short mark) { - pBuffer const pBD * Return value: 1, 0 */ - int b_eob(Buffer* const pBD) { +int b_eob(Buffer* const pBD) { if (!pBD) { return R_FAIL1; } return pBD->eob; } @@ -379,7 +379,7 @@ int b_print(Buffer* const pBD) { /* Loads symbols from a file to the buffer * Author: Victor Fernandes, 040772243 * Version: 0.0.1 - * Called functions: N/A + * Called functions: fgetc, feof, b_addc * Parameters: - FILE* const fi - pBuffer const pBD diff --git a/platy_gnu b/platy_gnu index 93864025c57da4a30adddccdea00fb28e7fdd847..a8782271ef76a66471235a5a4327b7a41e1c4357 100755 GIT binary patch delta 40 wcmcapaHn8H1B(FnHAeO3jrM%gy@PZ9hrH(4Jb@)zh}G1{%Ftx<2eBMQ08}{-Qvd(} delta 40 ycmV+@0N4NAaNKaPfCLboXJ?St-ZBD&%c8{bfC}@okOW&21v4``G%>UA7HlDv`4Q*< diff --git a/test/ass1ai_test.out b/test/ass1ai_test.out index a3e5a23..fc1b7fa 100644 --- a/test/ass1ai_test.out +++ b/test/ass1ai_test.out @@ -19,6 +19,7 @@ Isn't that nice? =:) CST8152 Autumn, 2016˙ +6 Printing buffer parameters: @@ -39,3 +40,4 @@ Isn't that nice? =:) CST8152 Autumn, 2016˙˙ +˙