1. 27 May, 2019 3 commits
  2. 26 May, 2019 4 commits
  3. 25 May, 2019 17 commits
  4. 24 May, 2019 4 commits
  5. 23 May, 2019 12 commits
    • Lioncash's avatar
      common/file_util: Remove unnecessary return at end of void StripTailDirSlashes() · e7ab0e91
      Lioncash authored
      While we're at it, also invert the conditional into a guard clause.
      e7ab0e91
    • Lioncash's avatar
      common/file_util: Make GetCurrentDir() return a std::optional · 11e9bee9
      Lioncash authored
      nullptr was being returned in the error case, which, at a glance may
      seem perfectly OK... until you realize that std::string has the
      invariant that it may not be constructed from a null pointer. This
      means that if this error case was ever hit, then the application would
      most likely crash from a thrown exception in std::string's constructor.
      
      Instead, we can change the function to return an optional value,
      indicating if a failure occurred.
      11e9bee9
    • Lioncash's avatar
      common/file_util: Remove duplicated documentation comments · 943f6da1
      Lioncash authored
      These are already present within the header, so they don't need to be
      repeated in the cpp file.
      943f6da1
    • Lioncash's avatar
      common/file_util: Make ReadFileToString and WriteStringToFile consistent · 2b1fcc8a
      Lioncash authored
      Makes the parameter ordering consistent, and also makes the filename
      parameter a std::string. A std::string would be constructed anyways with
      the previous code, as IOFile's only constructor with a filepath is one
      taking a std::string.
      
      We can also make WriteStringToFile's string parameter utilize a
      std::string_view for the string, making use of our previous changes to
      IOFile.
      2b1fcc8a
    • Lioncash's avatar
      common/file_util: Remove unnecessary c_str() calls · e3b25399
      Lioncash authored
      The file stream open functions have supported std::string overloads
      since C++11, so we don't need to use c_str() here. Same behavior, less
      code.
      e3b25399
    • Lioncash's avatar
      common/file_util: Make IOFile's WriteString take a std::string_view · 8cd3d9be
      Lioncash authored
      We don't need to force the usage of a std::string here, and can instead
      use a std::string_view, which allows writing out other forms of strings
      (e.g. C-style strings) without any unnecessary heap allocations.
      8cd3d9be
    • Lioncash's avatar
      shader/shader_ir: Make Comment() take a std::string by value · b6dcb1ae
      Lioncash authored
      This allows for forming comment nodes without making unnecessary copies
      of the std::string instance.
      
      e.g. previously:
      
      Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]",
              cbuf->GetIndex(), cbuf_offset));
      
      Would result in a copy of the string being created, as CommentNode()
      takes a std::string by value (a const ref passed to a value parameter
      results in a copy).
      
      Now, only one instance of the string is ever moved around. (fmt::format
      returns a std::string, and since it's returned from a function by value,
      this is a prvalue (which can be treated like an rvalue), so it's moved
      into Comment's string parameter), we then move it into the CommentNode
      constructor, which then moves the string into its member variable).
      b6dcb1ae
    • Lioncash's avatar
      shader/decode/*: Add missing newline to files lacking them · 228e58d0
      Lioncash authored
      Keeps the shader code file endings consistent.
      228e58d0
    • Lioncash's avatar
      shader/decode/*: Eliminate indirect inclusions · 87b4c1ac
      Lioncash authored
      Amends cases where we were using things that were indirectly being
      satisfied through other headers. This way, if those headers change and
      eliminate dependencies on other headers in the future, we don't have
      cascading compilation errors.
      87b4c1ac
    • Lioncash's avatar
      service/aoc: Avoid allocating and discarding data · 3e7d3730
      Lioncash authored
      Previously, the code was accumulating data into a std::vector and then
      tossing all of it away if a setting was disabled.
      
      Instead, we can just check if it's disabled and do no work at all if
      possible. If it's enabled, then we can append to the vector and
      allocate.
      
      Unlikely to impact usage much, but it is slightly less sloppy with
      resources.
      3e7d3730
    • Lioncash's avatar
      service/aoc: Remove unnecessary includes · d0e200a8
      Lioncash authored
      Removes two header dependencies related to file handling that aren't
      actually used within the source file.
      d0e200a8
    • Lioncash's avatar
      service/aoc: Pop all passed values where applicable · 819d229e
      Lioncash authored
      A few of the aoc service stubs/implementations weren't fully popping all
      of the parameters passed to them. This ensures that all parameters are
      popped and, at minimum, logged out.
      819d229e