summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLibravatar Mubashshir <ahmubashshir@gmail.com>2023-10-28 20:05:49 +0600
committerLibravatar Mubashshir <ahmubashshir@gmail.com>2023-10-28 20:05:49 +0600
commit7455c3d0bda6ab60d3f67fafd0ce04428143bcbe (patch)
tree4a139278995f0602469b10223aaa448ae0a967f9 /src/main.c
parentc47100c331e1fcc4353b6ed83a1d3485c9331eaf (diff)
downloadc-obp-example-7455c3d0bda6ab60d3f67fafd0ce04428143bcbe.tar.gz
c-obp-example-7455c3d0bda6ab60d3f67fafd0ce04428143bcbe.zip
Use better names for reference helpers
Signed-off-by: Mubashshir <ahmubashshir@gmail.com>
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 9edf6a6..a42b5a6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5,9 +5,10 @@
#include "teams.h"
#include "common.h"
-// ref(type) references content is always const
-// mut(type) references content is mutable
-void process(const ref(char) line, unsigned idx, team obj)
+// ref(type) -> const ref to const data
+// mut(type) -> const ref to mut data
+// ptr(type) -> mut ref to mut data
+void process(ref(char) line, unsigned idx, team obj)
{
unsigned s;
switch(idx) {
@@ -35,7 +36,7 @@ int main()
{
unsigned num = 0, i = 0;
char line[255] = "";
- team *teams;
+ ptr(team) teams;
getline(line, 255, stdin);
consume(line, 255, sscanf, "%u", &num);