<commit_before>// @(#)root/win32:$Name$:$Id$
// Author: <NAME>   27/01/96

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TGWin32Marker.h"

//______________________________________________________________________________
TGWin32Marker::TGWin32Marker(int n, TPoint *xy, int type){
  fNumNode = n;
  fMarkerType = type;
  if (type >= 2)
     if (fChain = new POINT[n])
      for( int i = 0; i < n; i++ ) {
                 fChain[i].x = xy[i].GetX();
                 fChain[i].y = xy[i].GetY();
      }
  else
     fChain = NULL;
}
//______________________________________________________________________________
TGWin32Marker::~TGWin32Marker(){
//*-*-*-*-*-*-*-*-*-*-*-*Default Destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                    ==================
  if (fChain) delete fChain;
}

//______________________________________________________________________________
int    TGWin32Marker::GetNumber(){return fNumNode;}
//______________________________________________________________________________
POINT *TGWin32Marker::GetNodes(){return fChain;}
//______________________________________________________________________________
int  TGWin32Marker::GetType(){return fMarkerType;}

//______________________________________________________________________________
void TGWin32Marker::SetMarker(int n, TPoint *xy, int type){

//*-* Did we have a chain ?

if (fMarkerType >= 2 && fNumNode != n){    // Yes, we had chain
       if (fChain) delete fChain;  // Delete the obsolete chain
       fChain = NULL;
}

//*-*  Create the new shaped marker

if (type >= 2) {
    if (!fChain) fChain = new POINT[n];
    for( int i = 0; i < n; i++ ) {
      fChain[i].x = xy[i].GetX();
      fChain[i].y = xy[i].GetY();
    }
}
else if (fChain) { delete fChain; fChain = NULL; }

fNumNode = n;
fMarkerType = type;

}
<commit_msg>fChain was not always initialized in the constructor. Also fix a bracket problem. Thanks Philippe<commit_after>// @(#)root/win32:$Name:  $:$Id: TGWin32Marker.cxx,v 1.1.1.1 2000/05/16 17:00:46 rdm Exp $
// Author: <NAME>   27/01/96

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TGWin32Marker.h"

//______________________________________________________________________________
TGWin32Marker::TGWin32Marker(int n, TPoint *xy, int type){
  fNumNode = n;
  fMarkerType = type;
  if (type >= 2) {
     if (fChain = new POINT[n]) {
        for( int i = 0; i < n; i++ ) {
           fChain[i].x = xy[i].GetX();
           fChain[i].y = xy[i].GetY();
        }
     } else {
        fChain = 0;
     }
  } else {
     fChain = 0;
  }
}
//______________________________________________________________________________
TGWin32Marker::~TGWin32Marker(){
//*-*-*-*-*-*-*-*-*-*-*-*Default Destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                    ==================
  if (fChain) delete fChain;
}

//______________________________________________________________________________
int    TGWin32Marker::GetNumber(){return fNumNode;}
//______________________________________________________________________________
POINT *TGWin32Marker::GetNodes(){return fChain;}
//______________________________________________________________________________
int  TGWin32Marker::GetType(){return fMarkerType;}

//______________________________________________________________________________
void TGWin32Marker::SetMarker(int n, TPoint *xy, int type){

//*-* Did we have a chain ?

if (fMarkerType >= 2 && fNumNode != n){    // Yes, we had chain
       if (fChain) delete fChain;  // Delete the obsolete chain
       fChain = NULL;
}

//*-*  Create the new shaped marker

if (type >= 2) {
    if (!fChain) fChain = new POINT[n];
    for( int i = 0; i < n; i++ ) {
      fChain[i].x = xy[i].GetX();
      fChain[i].y = xy[i].GetY();
    }
}
else if (fChain) { delete fChain; fChain = NULL; }

fNumNode = n;
fMarkerType = type;

}

{'fraction_non_alphanumeric': 0.2024232295801128, 'fraction_numerical': 0.020889910173386254, 'mean_word_length': 2.7939778129952457, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7560561', 'n_tokens_mistral': 1365, 'n_tokens_neox': 1239, 'n_words': 308}