mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Warning cleanup
- ignoring const - declarations after statements - some C files didnt include own headers (risking them getting out of sync) Closes #1064
This commit is contained in:
committed by
TingPing
parent
9fb4eb5107
commit
f83d78dd28
@@ -53,8 +53,9 @@ void get_hwmon_chip_name(char *name)
|
||||
void get_hwmon_temp(unsigned int *value, unsigned int *sensor)
|
||||
{
|
||||
char buffer[bsize];
|
||||
FILE *fp;
|
||||
snprintf(buffer, bsize, "/sys/class/hwmon/hwmon0/device/temp%i_input", *sensor);
|
||||
FILE *fp = fopen(buffer, "r");
|
||||
fp = fopen(buffer, "r");
|
||||
if(fp != NULL) {
|
||||
if(fgets(buffer, bsize, fp) != NULL)
|
||||
*value = atoi(buffer);
|
||||
|
||||
@@ -32,12 +32,12 @@ float percentage(unsigned long long *free, unsigned long long *total)
|
||||
|
||||
char *pretty_freespace(const char *desc, unsigned long long *free_k, unsigned long long *total_k)
|
||||
{
|
||||
char *result, **quantity;
|
||||
char *quantities[] = { "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", 0 };
|
||||
char *result, **quantity;
|
||||
double free_space, total_space;
|
||||
free_space = *free_k;
|
||||
total_space = *total_k;
|
||||
result = malloc(bsize * sizeof(char));
|
||||
char *quantities[] = { "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", 0 };
|
||||
if (total_space == 0)
|
||||
{
|
||||
snprintf(result, bsize, "%s: none", desc);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "match.h"
|
||||
#include "hwmon.h"
|
||||
#include "xsys.h"
|
||||
#include "parse.h"
|
||||
|
||||
int xs_parse_cpu(char *model, char *vendor, double *freq, char *cache, unsigned int *count)
|
||||
{
|
||||
|
||||
@@ -115,9 +115,10 @@ void pci_find_fullname(char *fullname, char *vendor, char *device)
|
||||
char devicename[bsize/2] = "";
|
||||
char *position;
|
||||
int cardfound = 0;
|
||||
FILE *fp;
|
||||
|
||||
sysinfo_get_pciids (buffer);
|
||||
FILE *fp = fopen (buffer, "r");
|
||||
fp = fopen (buffer, "r");
|
||||
|
||||
if(fp == NULL) {
|
||||
snprintf(fullname, bsize, "%s:%s", vendor, device);
|
||||
|
||||
@@ -878,11 +878,11 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
||||
int
|
||||
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
||||
{
|
||||
char buffer[bsize];
|
||||
ph = plugin_handle;
|
||||
*plugin_name = name;
|
||||
*plugin_desc = desc;
|
||||
*plugin_version = version;
|
||||
char buffer[bsize];
|
||||
|
||||
hexchat_hook_command (ph, "SYSINFO", HEXCHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL);
|
||||
hexchat_hook_command (ph, "NETDATA", HEXCHAT_PRI_NORM, netdata_cb, NULL, NULL);
|
||||
|
||||
Reference in New Issue
Block a user