NO

Recent Posts

Pages: 1 ... 8 9 [10]
91
Bug reports / Re: Bug in atomic_is_lock_free?
« Last post by Pelle on May 01, 2023, 04:45:47 PM »
As far as I understand, the pointed-to object must be atomic so float * _Atomic or _Atomic float * _Atomic but not _Atomic float *.

FWIW, a recent version of LLVM seems to agree about the errors (and IMHO the C11/C17/C2X standard could be a little clearer about atomic types).
92
Add-ins / Re: OpenPrjToMsvc and PrjToVCProj Add-Ins
« Last post by Pelle on May 01, 2023, 04:30:52 PM »
poide v12 started to use UNICODE for project files, so these old ANSI based Add-Ins stops working.
Um... the default encoding for project files was changed to UTF-16 almost exactly five years ago (2018-05-02)...
93
Bug reports / Bug in atomic_is_lock_free?
« Last post by Werner on May 01, 2023, 04:18:21 PM »
The standard states in 7.17.5.1 that atomic_is_lock_free has to be called with *a pointer to* the object in dispute.
So, except I am terribly mistaken, if the object is a pointer, one has to pass a pointer to a pointer.
But in the following test code one gets e. g.:

error #2141: Type error in argument 1 to 'atomic_is_lock_free'; '_Atomic float * *' is invalid.

Am I missing or misunderstanding something?

Code: [Select]
#include <stdatomic.h>
#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    _Atomic float        var_float;
    _Atomic double       var_double;
    _Atomic long double  var_long_double;
    _Atomic float*       p_var_float;
    _Atomic double*      p_var_double;
    _Atomic long double* p_var_long_double;
   
    atomic_init(&var_float, 42.0);
    atomic_init(&var_double, 4711.1);
    atomic_init(&var_long_double, 1000000.12);
    atomic_init(&p_var_float, &var_float);
    atomic_init(&p_var_double, &var_double);
    atomic_init(&p_var_long_double, &var_long_double);

    printf("\"_Atomic float        var_float\"         is %slock-free.\n", atomic_is_lock_free(& var_float)        ? "" : "not ");
    printf("\"_Atomic double       var_double\"        is %slock-free.\n", atomic_is_lock_free(& var_double)       ? "" : "not ");
    printf("\"_Atomic long double  var_long_double\"   is %slock-free.\n", atomic_is_lock_free(& var_long_double)  ? "" : "not ");
    printf("\"_Atomic float*       p_var_float\"       is %slock-free.\n", atomic_is_lock_free(&p_var_float)       ? "" : "not ");
    printf("\"_Atomic double*      p_var_double\"      is %slock-free.\n", atomic_is_lock_free(&p_var_double)      ? "" : "not ");
    printf("\"_Atomic long double* p_var_long_double\" is %slock-free.\n", atomic_is_lock_free(&p_var_long_double) ? "" : "not ");

    exit(EXIT_SUCCESS);
}

Werner (on version 12.00)

94
Bug reports / Re: Issue in editor with Unicode (v12RC1) ?
« Last post by Fool-DupleX on May 01, 2023, 01:39:02 PM »
Actually, I do not know if the BOM is the issue or not. But there's a consistency problem between loading and saving a text resource. IDR_HTM_WELCOME in my case. Save it once, it will not open properly the next time (see my screenshots). null chars are seen as ascii at some point somewhere.
95
Feature requests / Re: Translations of add-ins
« Last post by Fool-DupleX on May 01, 2023, 01:31:54 PM »
Thanks for the answer. I expected that the translation of add-ins at this stage at least, could be an issue. I will put that aside for the time being and focus on the translation package itself.
96
Add-ins / Re: OpenPrjToMsvc and PrjToVCProj Add-Ins
« Last post by TimoVJL on May 01, 2023, 11:30:48 AM »
poide v12 started to use UNICODE for project files, so these old ANSI based Add-Ins stops working.

https://forum.pellesc.de/index.php?topic=7284.msg27667#msg27667
97
Assembly discussions / Extracting the icon of an executable
« Last post by Vortex on April 30, 2023, 07:52:40 PM »
Hello,

Here is an example of extracting the icon of an executable with Component Object Modeling ( COM ) :

Code: [Select]
include     SaveIcon.inc

.data

IID_IPicture  GUID <7BF80980h,0BF32h,101Ah,<8Bh,0BBh,00h,0AAh,00h,30h,0Ch,0ABh>>
IconName    db 'TestIcon.ico',0
file1       db 'Bug.exe',0
errmsg      db 'Bug.exe could not be loaded.',13,10,0

.data?

hIcon       dd ?
pBitmap     dd ?
hGlobal     dd ?
pcbSize     dd ?
pStream     dd ?
hLib        dd ?
pd          PICTDESC <?>
bm          BITMAP <?>

.code

start:

    invoke      LoadLibrary,ADDR file1
    test        eax,eax
    jnz         @f
    invoke      StdOut,ADDR errmsg
    invoke      ExitProcess,0
@@:
    mov         hLib,eax
    invoke      LoadIcon,eax,100
    mov         hIcon,eax

    mov         pd.cbSizeofstruct,SIZEOF PICTDESC   ; initialize the PICTDESC structure
    mov         pd.picType,PICTYPE_ICON
    push        hIcon
    pop         pd.icon.hicon
    invoke      OleCreatePictureIndirect,ADDR pd,ADDR IID_IPicture,TRUE,ADDR pBitmap
                                                    ; create the OLE image
    invoke      CreateStreamOnHGlobal,NULL,TRUE,ADDR pStream
                                                    ; create the destination stream to save the icon

    coinvoke    pBitmap,IPicture,SaveAsFile,pStream,TRUE,<OFFSET pcbSize>
    invoke      GetHGlobalFromStream,pStream,ADDR hGlobal
    invoke      GlobalLock,hGlobal                  ; get the address pointing the icon in memory
    invoke      WriteFileToDisc,ADDR IconName,eax,pcbSize
                                                    ; write the icon to disc
    coinvoke    pBitmap,IPicture,Release
    coinvoke    pStream,IStream,Release
    invoke      FreeLibrary,hLib
    invoke      ExitProcess,0

OPTION PROLOGUE:NONE
OPTION EPILOGUE:NONE

StdOut PROC _string:DWORD

    sub         esp,2*4
   
    invoke      GetStdHandle,STD_OUTPUT_HANDLE
    mov         DWORD PTR [esp+4],eax
   
    invoke      lstrlen,DWORD PTR [esp+12]
    mov         edx,esp
   
    invoke      WriteFile,DWORD PTR [esp+20],\
                DWORD PTR [esp+24],\
                eax,edx,0
           
    add         esp,2*4
    retn        4

StdOut ENDP

OPTION PROLOGUE:PrologueDef
OPTION EPILOGUE:EpilogueDef
   
END start
98
Bug reports / Re: Issue in editor with Unicode (v12RC1) ?
« Last post by Pelle on April 29, 2023, 04:24:47 PM »
You want the BOM also when saving the text resource?? Why didn't you say so...??
(OK, I will fix it...)
99
Feature requests / Re: Translations of add-ins
« Last post by Pelle on April 29, 2023, 02:35:34 PM »
There are basically two ways to extend the IDE: writing an add-in DLL, or writing a project wizard DLL.

A project wizard can only, by definition, handle a single project. To be able to import a Visual Studio solution, possibly containing numerous (sub-)projects, an add-in DLL is the only option (since this has no business being part of the core IDE code).

For both add-in and project wizard DLLs, the only realistic way to add translations is to stack them on top of each other in the same DLL. This will however be hard to maintain in practice. Having them load translations from the IDE language file is also not practical.

I guess "Import Microsoft Visual Studio Solution..." could be changed from a menu entry to a toolbar icon, but this would make it less visible/obvious. Including the source of this add-in in the distribution is another option, but still no real help handling multiple translations...
100
Bug reports / Re: Issue in editor with Unicode (v12RC1) ?
« Last post by John Z on April 29, 2023, 01:41:44 PM »
Merci HellOfMice !  :)

Since I'm new here, what is the process to report a bug ? Is this thread enough, or should I contact Pelle ?

This is the right place: Bug Report section.  Pelle reviews it, and others help verify, disprove, or provide workarounds based on the report.  Each 'BUG' report is a separate subject/topic entry.

John Z
Pages: 1 ... 8 9 [10]