Skip to content

Commit 4a94ebf

Browse files
committed
reduced amount of system calls
reduced amount of system calls by removing unnesesary printfs
1 parent a10c26f commit 4a94ebf

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

src/cpu/cpu_info.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ void print_cpu_info(void)
2222
{
2323
FILE *cpu_file;
2424

25-
printf(" ____________\n");
26-
printf("|\n");
27-
printf("| CPU Info:\n");
28-
printf("|____________\n");
29-
printf("|\n");
25+
printf(" ____________\n\
26+
|\n\
27+
| CPU Info:\n\
28+
|____________\n\
29+
|\n");
3030

3131
cpu_file = fopen("/proc/cpuinfo", "r");
3232
if (cpu_file) {
@@ -50,11 +50,11 @@ void print_full_cpu_info(void)
5050
{
5151
FILE *cpu_file;
5252

53-
printf(" ____________\n");
54-
printf("|\n");
55-
printf("| Full CPU Info:\n");
56-
printf("|____________\n");
57-
printf("|\n");
53+
printf(" ____________\n\
54+
|\n\
55+
| Full CPU Info:\n\
56+
|____________\n\
57+
|\n");
5858

5959
cpu_file = fopen("/proc/cpuinfo", "r");
6060
if (cpu_file) {

src/hlp/hlp_info.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ hardware.\033[0m\n\n\
101101
void print_ver_info(void)
102102
{
103103
print_banner();
104-
printf("spynix v4.1.2\n\nFor more info visit: \
104+
printf("spynix v4.1.3\n\nFor more info visit: \
105105
\033[36mhttps://github.com/git-user-cpp/spynix\033[0m\n");
106106
}
107107

src/ram/ram_info.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ void print_ram_info(void)
2323
struct sysinfo sys_info;
2424
sysinfo(&sys_info);
2525

26-
printf(" ____________\n");
27-
printf("|\n");
28-
printf("| RAM Info\n");
29-
printf("|____________\n");
30-
printf("|\n");
26+
printf(" ____________\n\
27+
|\n\
28+
| RAM Info\n\
29+
|____________\n\
30+
|\n");
3131
printf("| Uptime: %ld Hours\n", sys_info.uptime / 60 / 60);
3232
printf("| Total RAM: %ld MiB\n",
3333
sys_info.totalram * sys_info.mem_unit / 1024 / 1024);

src/rom/rom_info.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ void print_rom_info(void)
2222
{
2323
struct statvfs fs_info;
2424

25-
printf(" ____________\n");
26-
printf("|\n");
27-
printf("| ROM Info:\n");
28-
printf("|____________\n");
29-
printf("|\n");
25+
printf(" ____________\n\
26+
|\n\
27+
| ROM Info:\n\
28+
|____________\n\
29+
|\n");
3030

3131
if (statvfs("/", &fs_info) == 0) {
3232
printf("| Total Disk Space: %ld MiB\n",

src/sys/sys_info.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ void print_sys_info(void)
2323
struct utsname sys_info;
2424
uname(&sys_info);
2525

26-
printf(" ____________\n");
27-
printf("|\n");
28-
printf("| System Info\n");
29-
printf("|____________\n");
30-
printf("|\n");
26+
printf(" ____________\n\
27+
|\n\
28+
| System Info\n\
29+
|____________\n\
30+
|\n");
3131
printf("| System Name: %s\n", sys_info.sysname);
3232
printf("| Host Name: %s\n", sys_info.nodename);
3333
printf("| Kernel Release: %s\n", sys_info.release);

0 commit comments

Comments
 (0)