Rockbox Development > Starting Development and Compiling

How to interpret .rej files?

(1/2) > >>

ww2-:
I'm trying to compile my own build with scroll acceleration patch, using a August 14th source (I understand that the August 15th build introduced changes too big for the patch to work properly).

The problem is I don't know the right way to make the changes indicated in reject files. Ok, lines with a '+' sign in front of them have to added to the source, and lines with a '-' sign in front of them have to be removed. But in what part of the source code should I make the addition or removal?

When trying to apply the scroll acceleration patch, for instance, I get the following errors:


--- Code: ---Hunk #1 FAILED at 563.
(...) -- saving rejects to file apps/settings.c.rej
--- End code ---

The settings.c.rej file:


--- Code: ---***************
*** 563,568 ****
      {1, S_O(warnon_erase_dynplaylist), false,
          "warn when erasing dynamic playlist", off_on },
 
      /* If values are just added to the end, no need to bump the version. */
      /* new stuff to be added at the end */
 
--- 563,573 ----
      {1, S_O(warnon_erase_dynplaylist), false,
          "warn when erasing dynamic playlist", off_on },
 
+ #if (CONFIG_KEYPAD == IPOD_4G_PAD) && !defined(IPOD_MINI)
+     {9, S_O(ipod_scroll_wheel_acceleration_fast), 55, "ipod scroll wheel fast threshold in clicks/sec", NULL }, /* 0...511 */
+     {9, S_O(ipod_scroll_wheel_acceleration_faster), 110, "ipod scroll wheel faster threshold in clicks/sec", NULL }, /* 0...511 */
+     {9, S_O(ipod_scroll_wheel_acceleration_fastest), 165, "ipod scroll wheel fastest threshold in clicks/sec", NULL }, /* 0...511 */
+ #endif   
      /* If values are just added to the end, no need to bump the version. */
      /* new stuff to be added at the end */
--- End code ---

I (erroneously) suppose the first block of code (line 563 to 568) is what the patcher found, and the second block (line 563 to 573) is how it should actually be. So, pursuing this logic, I open the settings.c file to add the changes, and here are the contents of line 563 to 568:


--- Code: ---    {9|SIGNED, S_O(eq_band3_gain), 0, "eq band 3 gain", NULL },
    {9|SIGNED, S_O(eq_band4_gain), 0, "eq band 4 gain", NULL },
#endif

#ifdef HAVE_DIRCACHE
    {1, S_O(dircache), false, "dircache", off_on },
--- End code ---

Seems to be totally unrelated, so I use the text editor to find the "{1, S_O(warnon_erase_dynplaylist), false," part. It is actually in line 579 of settings.c. What should I do?

I was unable to find any info on how to proceed in making the necessary alterations indicated in a .rej file or even on how to read (interpret) such a file. Can you please clarify this to me?

ryran:
You got it pretty close.

The thing is, when that patch was made '{1, S_O(warnon_erase_dynplaylist), false,' WAS at line 563; however, it no longer is (there have been bagazillions of changes to the source since TP made that patch), so patch wasn't really sure how to proceed. This is a simple one though--you can fix it by just inserting the + code, minus the plus and the additional space

--- Code: ---#if (CONFIG_KEYPAD == IPOD_4G_PAD) && !defined(IPOD_MINI)
    {9, S_O(ipod_scroll_wheel_acceleration_fast), 55, "ipod scroll wheel fast threshold in clicks/sec", NULL }, /* 0...511 */
    {9, S_O(ipod_scroll_wheel_acceleration_faster), 110, "ipod scroll wheel faster threshold in clicks/sec", NULL }, /* 0...511 */
    {9, S_O(ipod_scroll_wheel_acceleration_fastest), 165, "ipod scroll wheel fastest threshold in clicks/sec", NULL }, /* 0...511 */
--- End code ---
right before the '/* If values' blahblahblah line.

Also, this might be a good time to note: if you've already used the scroll acceleration patch and like me, found the defaults a little too crazy aggressive, these are the lines you can modify to change them (the defaults).

ww2-:
Thanks for answering =)

So, I suppose it's just a question of finding one or more references that are in both the .rej file and the source, then inserting the extra code without messing up any of the structure.

But how did you figure out that the block of code was to be inserted just before the
--- Code: ---/* If values (...)
--- End code ---
part, and not anywhere (anywhere that doesn't compromise the code structure, I mean) between
--- Code: ---{1, S_O(warnon_erase_dynplaylist), false (...)
--- End code ---
and
--- Code: ---/* If values (...)
--- End code ---
?

Would it work if I just inserted the extra code right after
--- Code: ---     {1, S_O(warnon_erase_dynplaylist), false (...)
--- End code ---
?

ww2-:
Anyway, I just compiled a build with several patches (scroll acceleration, quick menu exit, auto pause and usb connection) and everything worked fine. Did the necessary edits based on the .rej files and that part seems a lot more intuitive now. Thanks for your help.

ryran:
Awesome! Congrats! :)

Oh and to answer your last question: yes it would work fine. It's easier to just add it to the end of that section though, as in, by searching for that ending text.

Navigation

[0] Message Index

[#] Next page

Go to full version