mirror of
https://github.com/google/cpu_features.git
synced 2025-04-28 07:23:37 +02:00
[NFC] fix various errors
This commit is contained in:
parent
be306b7b15
commit
99d2363c62
@ -141,7 +141,7 @@ static Node* CreatePrintfString(const char* format, ...) {
|
|||||||
char* const ptr = gBumpAllocator.ptr;
|
char* const ptr = gBumpAllocator.ptr;
|
||||||
const int written = vsnprintf(ptr, gBumpAllocator.size, format, arglist);
|
const int written = vsnprintf(ptr, gBumpAllocator.size, format, arglist);
|
||||||
va_end(arglist);
|
va_end(arglist);
|
||||||
if (written < 0 || written >= gBumpAllocator.size) internal_error();
|
if (written < 0 || written >= (int)gBumpAllocator.size) internal_error();
|
||||||
return CreateConstantString((char*)BA_Bump(written));
|
return CreateConstantString((char*)BA_Bump(written));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,6 +231,8 @@ static void printJsonString(const char* str) {
|
|||||||
static void printJson(const Node* current) {
|
static void printJson(const Node* current) {
|
||||||
assert(current);
|
assert(current);
|
||||||
switch (current->type) {
|
switch (current->type) {
|
||||||
|
case NT_INVALID:
|
||||||
|
break;
|
||||||
case NT_INT:
|
case NT_INT:
|
||||||
printf("%d", current->integer);
|
printf("%d", current->integer);
|
||||||
break;
|
break;
|
||||||
@ -268,6 +270,8 @@ static void printJson(const Node* current) {
|
|||||||
// Walks a Node and print it as text.
|
// Walks a Node and print it as text.
|
||||||
static void printTextField(const Node* current) {
|
static void printTextField(const Node* current) {
|
||||||
switch (current->type) {
|
switch (current->type) {
|
||||||
|
case NT_INVALID:
|
||||||
|
break;
|
||||||
case NT_INT:
|
case NT_INT:
|
||||||
printf("%3d (0x%02X)", current->integer, current->integer);
|
printf("%3d (0x%02X)", current->integer, current->integer);
|
||||||
break;
|
break;
|
||||||
@ -314,7 +318,7 @@ static void showUsage(const char* name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static Node* CreateTree() {
|
static Node* CreateTree() {
|
||||||
Node* root = CreateMap(gBumpAllocator);
|
Node* root = CreateMap();
|
||||||
#if defined(CPU_FEATURES_ARCH_X86)
|
#if defined(CPU_FEATURES_ARCH_X86)
|
||||||
char brand_string[49];
|
char brand_string[49];
|
||||||
const X86Info info = GetX86Info();
|
const X86Info info = GetX86Info();
|
||||||
@ -367,7 +371,7 @@ static Node* CreateTree() {
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
BA_Align();
|
BA_Align();
|
||||||
const Node* const root = CreateTree(&gBumpAllocator);
|
const Node* const root = CreateTree();
|
||||||
bool outputJson = false;
|
bool outputJson = false;
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (; i < argc; ++i) {
|
for (; i < argc; ++i) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user