Procházet zdrojové kódy

changed cast to match type (review)

Signed-off-by: Adam Dąbrowski <[email protected]>
Adam Dąbrowski před 3 roky
rodič
revize
a5af919bcb
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      Gems/ROS2/Code/Source/Utilities/ROS2Names.cpp

+ 2 - 2
Gems/ROS2/Code/Source/Utilities/ROS2Names.cpp

@@ -93,7 +93,7 @@ namespace ROS2
             return AZ::Failure(AZStd::string("Unexpected field type: the only valid input is a character string"));
             return AZ::Failure(AZStd::string("Unexpected field type: the only valid input is a character string"));
         }
         }
 
 
-        AZStd::string ros2Namespace(static_cast<const char*>(newValue));
+        const AZStd::string& ros2Namespace(*reinterpret_cast<const AZStd::string*>(newValue));
         return ValidateNamespace(ros2Namespace);
         return ValidateNamespace(ros2Namespace);
     }
     }
 
 
@@ -122,7 +122,7 @@ namespace ROS2
             return AZ::Failure(AZStd::string("Unexpected field type: the only valid input is a character string"));
             return AZ::Failure(AZStd::string("Unexpected field type: the only valid input is a character string"));
         }
         }
 
 
-        AZStd::string topic(static_cast<const char*>(newValue));
+        const AZStd::string& topic(*reinterpret_cast<const AZStd::string*>(newValue));
         return ValidateTopic(topic);
         return ValidateTopic(topic);
     }
     }
 }  // namespace ROS2
 }  // namespace ROS2