diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | edid-decode.cpp | 14 | ||||
-rw-r--r-- | oui.h | 2 | ||||
-rw-r--r-- | parse-displayid-block.cpp | 2 |
4 files changed, 9 insertions, 13 deletions
@@ -24,10 +24,10 @@ all: edid-decode sha = -DSHA=$(shell if test -d .git ; then git rev-parse --short=12 HEAD ; fi) date = -DDATE=$(shell if test -d .git ; then TZ=UTC git show --quiet --date='format-local:"%F %T"' --format='%cd'; fi) -edid-decode: $(SOURCES) edid-decode.h Makefile +edid-decode: $(SOURCES) edid-decode.h oui.h Makefile $(CXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(WARN_FLAGS) -g $(sha) $(date) -o $@ $(SOURCES) -lm -edid-decode.js: $(SOURCES) edid-decode.h Makefile +edid-decode.js: $(SOURCES) edid-decode.h oui.h Makefile $(EMXX) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(WARN_FLAGS) $(sha) $(date) -s EXPORTED_FUNCTIONS='["_parse_edid"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' -o $@ $(SOURCES) -lm clean: diff --git a/edid-decode.cpp b/edid-decode.cpp index fb0cc81..1fc7fce 100644 --- a/edid-decode.cpp +++ b/edid-decode.cpp @@ -663,9 +663,9 @@ const char *oui_name(unsigned oui, unsigned *ouinum) if (!ouinum) ouinum = &ouinumscratch; const char *name; switch (oui) { - #define oneoui(c,k,n) case c: *ouinum = kOUI_##k; name = n; break; - #include "oui.h" - default: *ouinum = 0; name = NULL; + #define oneoui(c,k,n) case c: *ouinum = kOUI_##k; name = n; break; + #include "oui.h" + default: *ouinum = 0; name = NULL; break; } return name; } @@ -703,16 +703,12 @@ void edid_state::data_block_oui(std::string block_name, const unsigned char *x, oui = reversedoui; buf = ouitohex(oui); matched_reverse = true; - } - else if (do_ascii && valid_ascii) - { + } else if (do_ascii && valid_ascii) { unsigned asciioui = (x[0] << 24) + (x[1] << 16) + (x[2] << 8); ouiname = oui_name(asciioui, ouinum); - if (ouiname) { - matched_ascii = true; - } } } + matched_ascii = do_ascii && valid_ascii && ouiname != NULL; } std::string name; @@ -15,6 +15,6 @@ oneoui(0xca125c, Microsoft, "Microsoft" ) oneoui(0x3a0292, VESA, "VESA" ) // https://uefi.org/pnp_id_list -oneoui(0x505041, asciiApple, "Apple" ) // 'APP\0' +oneoui(0x415050, asciiApple, "Apple" ) // 'APP\0' #undef oneoui diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp index e512394..d527bf2 100644 --- a/parse-displayid-block.cpp +++ b/parse-displayid-block.cpp @@ -1651,7 +1651,7 @@ unsigned edid_state::displayid_block(const unsigned version, const unsigned char // DisplayID 1.3: case 0x00: data_block_oui("Product Identification Data Block (" + utohex(tag) + ")", - x + 3, len, &ouinum, true, true, false); + x + 3, len, &ouinum, true, true, true); dooutputname = false; hasoui = true; break; |