Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: Changes for c++17 #1376

Merged
merged 1 commit into from
Jan 18, 2025
Merged

cleanup: Changes for c++17 #1376

merged 1 commit into from
Jan 18, 2025

Conversation

stickz
Copy link
Contributor

@stickz stickz commented Jan 15, 2025

This cleanup adjusts the rTorrent code to comply with c++17 standard. It also simplifies various parts of the code.

src/rpc/parse_commands.cc Outdated Show resolved Hide resolved
src/rpc/parse_commands.cc Outdated Show resolved Hide resolved
@stickz stickz force-pushed the cleanup-c++17 branch 3 times, most recently from 0379d45 to ae9b101 Compare January 18, 2025 17:38
src/input/manager.cc Outdated Show resolved Hide resolved
@rakshasa
Copy link
Owner

(lldb) target create "/prefix/bin/rtorrent"
Current executable set to '/prefix/bin/rtorrent' (x86_64).
(lldb) settings set -- target.run-args  "-o" "system.daemon.set=true,import=/run/self/rc"
(lldb) settings set target.disable-aslr false
(lldb) run
rtorrent: Junk at end of input.
Process 106 exited with status = 255 (0x000000ff)

Getting this error.

This cleanup adjusts the rTorrent code to comply with c++17 standard. It also simplifies various parts of the code.
@stickz
Copy link
Contributor Author

stickz commented Jan 18, 2025

(lldb) target create "/prefix/bin/rtorrent"
Current executable set to '/prefix/bin/rtorrent' (x86_64).
(lldb) settings set -- target.run-args  "-o" "system.daemon.set=true,import=/run/self/rc"
(lldb) settings set target.disable-aslr false
(lldb) run
rtorrent: Junk at end of input.
Process 106 exited with status = 255 (0x000000ff)

Getting this error.

All fixed.

  if (first != last) {
    if (!command_map_is_newline(*first))
      throw torrent::input_error("Junk at end of input.");


    first++;
  }

@rakshasa
Copy link
Owner

It needs to check all from first to last.

@stickz
Copy link
Contributor Author

stickz commented Jan 18, 2025

It needs to check all from first to last.

This does the same thing as before the cleanup in src/rpc/parse_commands.cc. If we want to change the behavior of
parse_command(target_type target, const char* first, const char* last), I think we should create a new pull request. This pull request just cleans up the code to comply with the c++17 standard. It doesn't change the algorithm of the function.

@rakshasa rakshasa merged commit e7fc891 into rakshasa:master Jan 18, 2025
2 checks passed
@stickz stickz deleted the cleanup-c++17 branch January 18, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants