[haiku-bugs] [Haiku] #15534: HaikuDepot: Lists in the Model use Custom List Class

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Sun, 08 Dec 2019 18:04:04 -0000

#15534: HaikuDepot: Lists in the Model use Custom List Class
-------------------------------------+------------------------------
 Reporter:  apl-haiku                |        Owner:  stippi
     Type:  task                     |       Status:  new
 Priority:  high                     |    Milestone:  Unscheduled
Component:  Applications/HaikuDepot  |      Version:  R1/Development
 Keywords:  List BObjectList         |   Blocked By:
 Blocking:                           |  Has a Patch:  0
 Platform:  All                      |
-------------------------------------+------------------------------
 Some of the data-model in HaikuDepot (HD) uses a custom list class
 {{{List<T>}}}.  There is a warning in this class because it is using
 {{{memmove}}} on C++ objects which is not allowed;

 {{{
 ../haiku/src/apps/haikudepot/textview/ParagraphLayout.h:121:36:   required
 from here
 ../haiku/src/apps/haikudepot/List.h:273:11: warning: 'void* memcpy(void*,
 const void*, size_t)' writing to an object of type 'class TextSpan' with
 no trivial copy-assignment; use copy-assignment or copy-initialization
 instead [-Wclass-memaccess]
      memcpy(fItems, other.fItems, fCount * sizeof(ItemType));
 }}}

 The List has a notion of being able to maintain a sort ordering in order
 to speed-up searches into the list.

 It is possible to stop the warning from failing the build with the
 following line in the Jamfile;

 {{{
 ObjectC++Flags Model.cpp  : -Wno-error=class-memaccess ;
 }}}

 One this problem is resolved; remove this line from the Jamfile if it is
 there.

 However perhaps a better solution would be to use {{{BObjectList}}} or
 {{{std::list}}}.
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15534>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: