Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/45427 )

Change subject: base,dev: Rename major and minor variables
......................................................................

base,dev: Rename major and minor variables

Add a _version prefix. This is needed because there is
no cpu namespace yet.

Pave the way for a minor namespace.

Change-Id: Ic76415672f5421b838efc0913345c4b929e601f2
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/base/vnc/vncserver.cc
M src/dev/storage/disk_image.cc
2 files changed, 12 insertions(+), 10 deletions(-)



diff --git a/src/base/vnc/vncserver.cc b/src/base/vnc/vncserver.cc
index 3417fa5..7ecd3f9 100644
--- a/src/base/vnc/vncserver.cc
+++ b/src/base/vnc/vncserver.cc
@@ -387,20 +387,22 @@
         return;
     }

-    uint32_t major, minor;
+    uint32_t major_version, minor_version;

     // Figure out the major/minor numbers
-    if (sscanf(version_string, "RFB %03d.%03d\n", &major, &minor) != 2) {
+    if (sscanf(version_string, "RFB %03d.%03d\n", &major_version,
+            &minor_version) != 2) {
         warn(" Malformed protocol version %s\n", version_string);
         sendError("Malformed protocol version\n");
         detach();
         return;
     }

-    DPRINTF(VNC, "Client request protocol version %d.%d\n", major, minor);
+    DPRINTF(VNC, "Client request protocol version %d.%d\n", major_version,
+        minor_version);

     // If it's not 3.X we don't support it
-    if (major != 3 || minor < 2) {
+    if (major_version != 3 || minor_version < 2) {
         warn("Unsupported VNC client version... disconnecting\n");
         uint8_t err = AuthInvalid;
         write(&err);
@@ -408,7 +410,7 @@
         return;
     }
     // Auth is different based on version number
-    if (minor < 7) {
+    if (minor_version < 7) {
         uint32_t sec_type = htobe((uint32_t)AuthNone);
         if (!write(&sec_type))
             return;
diff --git a/src/dev/storage/disk_image.cc b/src/dev/storage/disk_image.cc
index 50e8cf2..2bb702b 100644
--- a/src/dev/storage/disk_image.cc
+++ b/src/dev/storage/disk_image.cc
@@ -248,13 +248,13 @@
     if (memcmp(&magic, "COWDISK!", sizeof(magic)) != 0)
         panic("Could not open %s: Invalid magic", file);

-    uint32_t major, minor;
-    SafeReadSwap(stream, major);
-    SafeReadSwap(stream, minor);
+    uint32_t major_version, minor_version;
+    SafeReadSwap(stream, major_version);
+    SafeReadSwap(stream, minor_version);

-    if (major != VersionMajor && minor != VersionMinor)
+    if (major_version != VersionMajor && minor_version != VersionMinor)
         panic("Could not open %s: invalid version %d.%d != %d.%d",
-              file, major, minor, VersionMajor, VersionMinor);
+ file, major_version, minor_version, VersionMajor, VersionMinor);

     uint64_t sector_count;
     SafeReadSwap(stream, sector_count);

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45427
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ic76415672f5421b838efc0913345c4b929e601f2
Gerrit-Change-Number: 45427
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to