mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v0.91][ARM] Fix for snapdragon chips reporting name in lowercase
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "soc.h"
|
#include "soc.h"
|
||||||
#include "udev.h"
|
#include "udev.h"
|
||||||
@@ -29,6 +30,18 @@ bool match_soc(struct system_on_chip* soc, char* raw_name, char* expected_name,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* toupperstr(char* str) {
|
||||||
|
int len = strlen(str) + 1;
|
||||||
|
char* ret = malloc(sizeof(char) * len);
|
||||||
|
memset(ret, 0, sizeof(char) * len);
|
||||||
|
|
||||||
|
for(int i=0; i < len; i++) {
|
||||||
|
ret[i] = toupper((unsigned char) str[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
#define SOC_START if (false) {}
|
#define SOC_START if (false) {}
|
||||||
#define CHECK_SOC(raw_name, expected_name, soc_name, soc_vendor, soc, process) \
|
#define CHECK_SOC(raw_name, expected_name, soc_name, soc_vendor, soc, process) \
|
||||||
else if (match_soc(soc, raw_name, expected_name, soc_name, soc_vendor, process)) return true;
|
else if (match_soc(soc, raw_name, expected_name, soc_name, soc_vendor, process)) return true;
|
||||||
@@ -177,12 +190,13 @@ bool match_mediatek(char* soc_name, struct system_on_chip* soc) {
|
|||||||
|
|
||||||
bool match_qualcomm(char* soc_name, struct system_on_chip* soc) {
|
bool match_qualcomm(char* soc_name, struct system_on_chip* soc) {
|
||||||
char* tmp;
|
char* tmp;
|
||||||
|
char* soc_name_upper = toupperstr(soc_name);
|
||||||
|
|
||||||
if((tmp = strstr(soc_name, "MSM")) != NULL);
|
if((tmp = strstr(soc_name_upper, "MSM")) != NULL);
|
||||||
else if((tmp = strstr(soc_name, "SDM")) != NULL);
|
else if((tmp = strstr(soc_name_upper, "SDM")) != NULL);
|
||||||
else if((tmp = strstr(soc_name, "APQ")) != NULL);
|
else if((tmp = strstr(soc_name_upper, "APQ")) != NULL);
|
||||||
else if((tmp = strstr(soc_name, "SM")) != NULL);
|
else if((tmp = strstr(soc_name_upper, "SM")) != NULL);
|
||||||
else if((tmp = strstr(soc_name, "QM")) != NULL);
|
else if((tmp = strstr(soc_name_upper, "QM")) != NULL);
|
||||||
else return false;
|
else return false;
|
||||||
|
|
||||||
SOC_START
|
SOC_START
|
||||||
|
|||||||
Reference in New Issue
Block a user