Changeset aeba445 in rtems


Ignore:
Timestamp:
Apr 24, 2013, 7:38:00 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
a290fbe9
Parents:
2f72de2
git-author:
Sebastian Huber <sebastian.huber@…> (04/24/13 07:38:00)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/26/13 08:57:07)
Message:

libcsupport: Remove superfluous assignments

Remove superfluous declaractions, defines, comments and includes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/newlibc_reent.c

    r2f72de2 raeba445  
    2323
    2424#if defined(RTEMS_NEWLIB)
     25
     26#include <sys/reent.h>
     27#include <stdlib.h>
     28#include <stdio.h>
     29
    2530#include <rtems/libcsupport.h>
    2631
    27 /* Since we compile with strict ANSI we need to undef it to get
    28  * prototypes for extensions
    29  */
    30 #undef __STRICT_ANSI__
    31 
    32 #include <stdlib.h>             /* for free() */
    33 #include <string.h>             /* for memset() */
    34 
    35 #include <sys/reent.h>          /* for extern of _REENT (aka _impure_ptr) */
    36 #include <errno.h>
    37 
    38 /*
    39  *  NOTE:
    40  *        There is some problem with doing this on the hpux version
    41  *        of the UNIX simulator (symptom is printf core dumps), so
    42  *        we just don't for now.
    43  *        Not sure if this is a problem with hpux, newlib, or something else.
    44  */
    45 
    46 #include <stdio.h>
    47 
    4832int _fwalk(struct _reent *ptr, int (*function) (FILE *) );
    49 
    50 extern struct _reent * const _global_impure_ptr __ATTRIBUTE_IMPURE_PTR__;
    5133
    5234bool newlib_create_hook(
     
    5638{
    5739  struct _reent *ptr;
     40  bool ok;
    5841
    5942  if (_Thread_libc_reent == 0)
    6043  {
    61     _REENT = _global_impure_ptr;
     44    _REENT = _GLOBAL_REENT;
    6245
    6346    _Thread_Set_libc_reent (&_REENT);
     
    6750   * hooks run with thread dispatching disabled.
    6851   */
    69   ptr = (struct _reent *) _Workspace_Allocate(sizeof(struct _reent));
     52  ptr = (struct _reent *) _Workspace_Allocate(sizeof(*ptr));
     53  creating_task->libc_reent = ptr;
     54  ok = ptr != NULL;
    7055
    71   if (ptr) {
     56  if (ok) {
    7257    _REENT_INIT_PTR((ptr)); /* GCC extension: structure constants */
    73     creating_task->libc_reent = ptr;
    74     return TRUE;
    7558  }
    7659
    77   return FALSE;
     60  return ok;
    7861}
    7962
     
    10588  struct _reent *ptr;
    10689
    107   if (current_task == deleted_task) {
    108     ptr = _REENT;
    109   } else {
    110     ptr = deleted_task->libc_reent;
    111   }
    112 
    113   if (ptr && ptr != _global_impure_ptr) {
    114 /*
    115     _wrapup_reent(ptr);
    116     _reclaim_reent(ptr);
    117 */
    118     /*
    119      *  Just in case there are some buffers lying around.
    120      */
    121     _fwalk(ptr, newlib_free_buffers);
    122 
    123     _Workspace_Free(ptr);
    124   }
    125 
     90  ptr = deleted_task->libc_reent;
    12691  deleted_task->libc_reent = NULL;
    12792
    12893  /*
    129    * Require the switch back to another task to install its own
     94   *  Just in case there are some buffers lying around.
    13095   */
     96  _fwalk(ptr, newlib_free_buffers);
    13197
    132   if ( current_task == deleted_task ) {
    133     _REENT = 0;
    134   }
     98  _Workspace_Free(ptr);
    13599}
    136100
Note: See TracChangeset for help on using the changeset viewer.