===========================================
This mail is made of the recycled electrons
===========================================
Mailer: Elm [revision: 70.85]
The code will be modified to:
if (paao->ftvl == 0 || paao->ftvl>DBF_ENUM ){
paao->bptr = (char *)calloc(paao->nelm,MAX_STRING_SIZE);
}
else {
paao->bptr = (char *)calloc(paao->nelm,sizeofTypes[paao->ftvl]);
}
return(0);
Thanks for the comments.
Johnny Tang
CEBAF
>
> Hi,
>
> in devAaiCamac.c and devAaoCamac.c files, calloc function is used to
> allocate memory space for an array by the following code.
>
> if (paao->ftvl == 0)
> paao->bptr = (char *)calloc(paao->nelm,MAX_STRING_SIZE);
> paao->bptr = (char *)calloc(paao->nelm,sizeofTypes[paao->ftvl]);
> return(0);
>
> In the case of paao->ftvl==0, the first allocated block is just replaced by
> new block in the following sentence.
> I think the code ubove should read,
>
> if (paao->ftvl == 0){
> paao->bptr = (char *)calloc(paao->nelm,MAX_STRING_SIZE);
> }
> else {
> paao->bptr = (char *)calloc(paao->nelm,sizeofTypes[paao->ftvl]);
> }
> return(0);
>
>
> Any comments?
> Noboru Yamamoto
> KEK, KEKB accelerator control group.
>
--
=============================================================
Johnny Tang Voice: (804)249-7239 E-Mail: [email protected]
Continous Electron Beam Accelerator Facility
12000 Jefferson Avernue, MS 85A
Newport News, Va 23606
=============================================================
- Navigate by Date:
- Prev:
devAaiCamac.c and devAaoCamac.c Noboru Yamamoto
- Next:
I'm just trying to follow orders... Bill Brown
- Index:
1994
<1995>
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
- Navigate by Thread:
- Prev:
devAaiCamac.c and devAaoCamac.c Noboru Yamamoto
- Next:
I'm just trying to follow orders... Bill Brown
- Index:
1994
<1995>
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
|