Recent Posts

Pages: 1 2 3 4 [5] 6 7 8 9 10
41
Development / Re: %I64d or %lld in the plugins\compilergcc\depslib\src\cache.c
« Last post by Wkerry on February 04, 2025, 08:39:58 am »
Try the following:
      #if  (_USE_LONG_TIME_T)
         sscanf(buf, "%ld %n", &timeval, &n);
      #else
         #if defined(PRId64)
            sscanf(buf, "%" PRId64 " %n", &timeval, &n);
         #else
            sscanf(buf, "%lld %n", &timeval, &n);
         #endif
      #endif

and
      #if  (_USE_LONG_TIME_T)
         fprintf(f, "%ld %s\n", h->time, h->file);
      #else
         #if defined(PRId64)
            fprintf(f, "%" PRId64 " %s\n", h->time, h->file);
         #else
            fprintf(f, "%lld %s\n", h->time, h->file);
         #endif
      #endif

This works better than the existing code. Give it a quick hack/ try, but you may find a better way.
42
Have a look at https://github.com/gerard-durand/codeblocks_gd_cbps as an example of how to do it for Windows only. This may save you some time.
43
Using Code::Blocks / Re: Hiccups while typing (continuation)
« Last post by ollydbg on February 04, 2025, 07:20:29 am »
Code
// ----------------------------------------------------------------------------
void ClassBrowser::SetParser(ParserBase* parser)
// ----------------------------------------------------------------------------
{
    if (m_Parser == parser)
        return;

    m_Parser = parser;
    if (m_Parser)
    {
        const int sel = XRCCTRL(*this, "cmbView", wxChoice)->GetSelection();
        BrowserDisplayFilter filter = static_cast<BrowserDisplayFilter>(sel);
        if (!m_ParseManager->IsParserPerWorkspace() && filter == bdfWorkspace)
            filter = bdfProject;

        m_Parser->ClassBrowserOptions().displayFilter = filter;
        m_Parser->WriteOptions();
        UpdateClassBrowserView();
    }
    else
        CCLogger::Get()->DebugLog("SetParser: No parser available.");
}

It looks like the "last Parser's option" is written to the configure file.

So, can we add a check here in the line 245 of the file: plugins\codecompletion\classbrowser.cpp

I mean if it is a dummy parser(temp parser), we won't need to save the parser's option?

Because when a cbp project get closed, the dummy parser is always active, so the dummy parser's option is always saved when I close the C::B. (But this has some issue, when user open C::B without opening any cbp file, all the option is saved to dummy parser)

Another method is that we can copy the option of a closed project to the dummy parser's option, so that the dummy parser's option will be the same as the last cbp project's option when get closed.
44
Development / %I64d or %lld in the plugins\compilergcc\depslib\src\cache.c
« Last post by ollydbg on February 04, 2025, 05:35:09 am »
Code
		/* C::B patch: Compatibility with 64 bit compiler / OS */
#if defined(_WIN64)
sscanf(buf, "%I64d %n", &timeval, &n);
#else
sscanf(buf, "%lld %n", &timeval, &n);
#endif

When I build the C::B, I see some code in the "plugins\compilergcc\depslib\src\cache.c" cause some warnings:

Code
D:\code\cb\cb_sf_git\cccrash2019\src\plugins\compilergcc\depslib\src\cache.c: In function 'cache_write':
D:\code\cb\cb_sf_git\cccrash2019\src\plugins\compilergcc\depslib\src\cache.c:173:33: warning: format '%d' expects argument of type 'int', but argument 3 has type 'time_t' {aka 'long long int'} [-Wformat=]
  173 |                 fprintf(f, "%I64d %s\n", h->time, h->file);
      |                             ~~~~^        ~~~~~~~
      |                                 |         |
      |                                 int       time_t {aka long long int}
      |                             %I64lld


I'm using msys2/mingw64's g++ compiler, and the "#if defined(_WIN64)" is true, so my question is:

why not just use the %lld?
45
Using Code::Blocks / Re: Hiccups while typing (continuation)
« Last post by ollydbg on February 04, 2025, 03:32:55 am »
If I remember correctly, it is a known bug for a long time. But I nearly forgot the details.

I just remember that: Each Parser instance(for each cbp projects) has there own CodeCompletion options, and when you saved the CodeCompletion options, it is only for the active Parser instance. But if you don't have any cbp file opened, there is still a special hidden Parser instance created for "dummy cbp projects".
46
Hi, when I try to build the whole C::B workspace against the "debug version of the wxWidgets", I need to change the "custom variable" named "WX_SUFFIX" from "u" to "ud".

This is simple if I only need to change this value in a single "cbp" file, but if I want to change them in all the cbps under the workspace, how to do that? I don't want to open the build option dialog for each cbp files.

Thanks.
47
Using Code::Blocks / Re: Hiccups while typing (continuation)
« Last post by Pecan on February 03, 2025, 06:44:06 pm »
Oh what's up, a bug ?
It seems that if I close C::B and I reopen it, the "Update parser when typing" setting gets enabled again ! Can you check ?
NB svn 13598

Yes, it's a bug. When CB is closed with a project active, a new setting of "Update parser..." will toggle itself.

When CB is closed with no project active, then "Update parser..." is changed,the "Update parser..." will hold.

So..., when I close all projects, change the "Update parser..." then close CB, the status of the check box will hold.

Weird !

Edit: 12:48 pm
When closing with no project open the CC parser is not involved.
When closing with a project open, the parser at 928 writes the value it was constructed with, not the updated value from the settings dialog.

cfg->Write(_T("/while_typing"), m_Options.whileTyping); //(ph 2025/02/03) wrong value when calledfrom ClassBrowser 245

Called from ClassBrowser 245: m_Parser->WriteOptions();
m_Options.whileTyping has the value before it was changed in settings dialog.

What I don't understand is why ClassBrowser has a stale value of the "Update parser..." value. In .conf it's named <WHILE_TYPING bool="0" />




48
Help / Font size adjust Project, Debug Windows
« Last post by c5ace on February 03, 2025, 01:26:29 am »
I can't find how to change the font size in the Project, Debug and some other windows. The font in Edit window is changeable. See attached screenshot.

Is there a way to set all fonts in all windows to the same size?

INFORMATION:
Name                   : Code::Blocks
Version                : svn-r13518
SDK Version            : 2.25.0
Scintilla Version      : 3.7.5
Author                 : The Code::Blocks Team
E-mail                 : info@codeblocks.org
Website                : https://www.codeblocks.org
OS                     : Linux 6.6.74-gentoo-x86_64 x86_64
Desktop environment    : XFCE
Scaling factor         : 1.000000
Detected scaling factor: 1.000000
Display PPI            : 96x96
Display count          : 1
Display 0              : XY=[0,0]; Size=[2560,1440]; Primary

wxWidgets Library (wxGTK port)
Version 3.2.5 (Unicode: wchar_t, debug level: 1),
compiled at Jan 18 2025 10:07:52

Runtime version of toolkit used is 3.24.
Compile-time GTK+ version is 3.24.42.


49
Help / Re: Issues with GDB and C::B
« Last post by nore on February 02, 2025, 11:52:32 pm »
I moved from the nightly build to a the 32-bit release (20.03) and everything is working now--only now the resolution of the application seems to be much lower... At least from the perspective of my laptop's DPI--investigation continues.

-nore
50
Using Code::Blocks / Re: Hiccups while typing (continuation)
« Last post by Elena on February 02, 2025, 11:10:50 pm »
Oh what's up, a bug ?
It seems that if I close C::B and I reopen it, the "Update parser when typing" setting gets enabled again ! Can you check ?
NB svn 13598
Pages: 1 2 3 4 [5] 6 7 8 9 10