Skip to content

Conversation

CarterLi
Copy link
Member

No description provided.

CarterLi and others added 30 commits July 19, 2025 16:47
… is disabled

This commit addresses an issue where the default route detection on Windows incorrectly identified a disabled adapter as the default route. Previously, when a user disabled the adapter configured as the default route, the system still reported it as active due to stale routing table entries.
It's less accurate, but higher chance to match.
@CarterLi CarterLi requested a review from Copilot July 31, 2025 02:45
Copilot

This comment was marked as outdated.

@CarterLi CarterLi requested a review from Copilot July 31, 2025 02:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This release introduces v2.49.0 with significant enhancements across display formatting, package management, and hardware detection. The release focuses on improved consistency in unit formatting, better hardware support, and enhanced configuration options.

  • Added comprehensive space-before-unit options for duration, size, frequency, temperature, and percentage values
  • Enhanced package manager support with improved Scoop detection on Windows and removal of qi package manager
  • Improved hardware detection including nouveau GPU driver support, ARM SoC detection, and Intel GPU temperature accuracy

Reviewed Changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/strbuf.c Added comprehensive tests for new ffStrbufSubstr and ffStrbufAppendUtf32CodePoint functions
tests/duration.c Updated to use new duration formatting API and added extensive abbreviation tests
src/util/FFstrbuf.h Added declarations for substring extraction and UTF-32 code point conversion functions
src/util/FFstrbuf.c Implemented new string manipulation functions with proper bounds checking
src/util/FFcheckmacros.h Enhanced macro definitions using __has_attribute for better compiler compatibility
src/options/display.h Added new space-before-unit configuration options for various display types
presets/examples/25.jsonc Enhanced documentation with detailed explanations of ANSI escape codes and formatting
Various modules Updated to use new common formatting functions (size, frequency, duration) for consistency

@@ -461,6 +462,26 @@ bool ffStrbufSubstrAfterLastC(FFstrbuf* strbuf, char c)
return true;
}

bool ffStrbufSubstr(FFstrbuf* strbuf, uint32_t start, uint32_t end)
{
if (__builtin_expect(start >= end, false))
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The use of __builtin_expect for this condition seems unnecessary as start >= end is not particularly predictable and the branch misprediction cost is minimal for a simple comparison. Consider removing the hint for better code readability.

Suggested change
if (__builtin_expect(start >= end, false))
if (start >= end)

Copilot uses AI. Check for mistakes.

return false;
}

if (__builtin_expect(start == 0, false)) return ffStrbufSubstrBefore(strbuf, end);
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The branch hint false for start == 0 may not be accurate for all use cases. This condition could be common in many substring operations. Consider removing the hint or using a more neutral approach.

Suggested change
if (__builtin_expect(start == 0, false)) return ffStrbufSubstrBefore(strbuf, end);
if (start == 0) return ffStrbufSubstrBefore(strbuf, end);

Copilot uses AI. Check for mistakes.

}

if (__builtin_expect(start == 0, false)) return ffStrbufSubstrBefore(strbuf, end);
if (__builtin_expect(end >= strbuf->length, false)) return ffStrbufSubstrAfter(strbuf, start - 1);
Copy link
Preview

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The branch hint false for end >= strbuf->length assumes that most substring operations don't extend to the end of the string, which may not always be true. Consider removing the hint for better maintainability.

Suggested change
if (__builtin_expect(end >= strbuf->length, false)) return ffStrbufSubstrAfter(strbuf, start - 1);
if (end >= strbuf->length) return ffStrbufSubstrAfter(strbuf, start - 1);

Copilot uses AI. Check for mistakes.

@CarterLi CarterLi merged commit ba8a211 into master Jul 31, 2025
43 checks passed
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.

3 participants