Changeset 69
- Timestamp:
- 08/30/11 12:23:52 (21 months ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
-
pspio_qn.c (modified) (2 diffs)
-
pspio_qn.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/pspio_qn.c
r65 r69 25 25 26 26 int pspio_qn_alloc(pspio_qn_t *qn) { 27 qn = (pspio_qn_t *)malloc(sizeof(pspio_qn_t)); 27 if ( qn != NULL ) { 28 return PSPIO_ERROR; 29 } 30 qn = (pspio_qn_t *)malloc(sizeof(qn)); 28 31 if ( qn == NULL ) { 29 32 return PSPIO_ERROR; … … 33 36 qn->l = 0; 34 37 qn->j = 0.0; 38 39 return PSPIO_SUCCESS; 40 } 41 42 43 int pspio_qn_copy(pspio_qn_t *dst, pspio_qn_t *src) { 44 if ( (src == NULL) || (dst != NULL) ) { 45 return PSPIO_ERROR; 46 } 47 48 dst = (pspio_qn_t *)malloc(sizeof(dst)); 49 if ( dst == NULL ) { 50 return PSPIO_ERROR; 51 } 52 dst->n = src->n; 53 dst->l = src->l; 54 dst->j = src->j; 35 55 36 56 return PSPIO_SUCCESS; -
trunk/src/pspio_qn.h
r57 r69 49 49 50 50 /** 51 * Allocates and presets a nquantum number structure.51 * Allocates and presets a quantum number structure. 52 52 * @param[out] qn: quantum number structure pointer to allocate 53 53 * @return error code 54 54 */ 55 55 int pspio_qn_alloc(pspio_qn_t *qn); 56 57 58 /** 59 * Duplicates a quantum number structure. 60 * @param[out] dst: destination quantum number structure pointer 61 * @param[out] src: source quantum number structure pointer 62 * @return error code 63 */ 64 int pspio_qn_copy(pspio_qn_t *dst, pspio_qn_t *src); 56 65 57 66
Note: See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/trac/libpspio/chrome/site/your_project_logo.png)