VirtualBox

Changeset 102178 in vbox


Ignore:
Timestamp:
Nov 21, 2023 9:20:06 AM (17 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160303
Message:

libs/xpcom: Remove more unused code, bugref:10545

Location:
trunk/src/libs/xpcom18a4/nsprpub/pr
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h

    r102176 r102178  
    115115*/
    116116
    117 #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
    118 #define PT_FPrintStats VBoxNsprPT_FPrintStats
    119 #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
    120 
    121117PR_BEGIN_EXTERN_C
    122118
     
    181177#define PT_THREAD_RESUMED   0x80    /* thread has been resumed */
    182178#define PT_THREAD_SETGCABLE 0x100   /* set the GCAble flag */
    183 
    184 #if defined(DEBUG)
    185 
    186 typedef struct PTDebug
    187 {
    188     PRTime timeStarted;
    189     PRUintn locks_created, locks_destroyed;
    190     PRUintn locks_acquired, locks_released;
    191     PRUintn cvars_created, cvars_destroyed;
    192     PRUintn cvars_notified, delayed_cv_deletes;
    193 } PTDebug;
    194 
    195 #endif /* defined(DEBUG) */
    196 
    197 NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg);
    198179
    199180/************************************************************************/
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/prtime.h

    r11551 r102178  
    5656#define PR_ImplodeTime VBoxNsprPR_ImplodeTime
    5757#define PR_NormalizeTime VBoxNsprPR_NormalizeTime
    58 #define PR_LocalTimeParameters VBoxNsprPR_LocalTimeParameters
    59 #define PR_GMTParameters VBoxNsprPR_GMTParameters
    60 #define PR_USPacificTimeParameters VBoxNsprPR_USPacificTimeParameters
    61 #define PR_ParseTimeString VBoxNsprPR_ParseTimeString
    62 #define PR_FormatTime VBoxNsprPR_FormatTime
    63 #define PR_FormatTimeUSEnglish VBoxNsprPR_FormatTimeUSEnglish
    6458#endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
    6559
     
    231225    PRExplodedTime *exploded, PRTimeParamFn params);
    232226
    233 /**********************************************************************/
    234 /*********************** TIME PARAMETER FUNCTIONS *********************/
    235 /**********************************************************************/
    236 
    237 /* Time parameters that suit current host machine */
    238 NSPR_API(PRTimeParameters) PR_LocalTimeParameters(const PRExplodedTime *gmt);
    239 
    240 /* Time parameters that represent Greenwich Mean Time */
    241 NSPR_API(PRTimeParameters) PR_GMTParameters(const PRExplodedTime *gmt);
    242 
    243 /*
    244  * Time parameters that represent the US Pacific Time Zone, with the
    245  * current daylight saving time rules (for testing only)
    246  */
    247 NSPR_API(PRTimeParameters) PR_USPacificTimeParameters(const PRExplodedTime *gmt);
    248 
    249 /*
    250  * This parses a time/date string into a PRTime
    251  * (microseconds after "1-Jan-1970 00:00:00 GMT").
    252  * It returns PR_SUCCESS on success, and PR_FAILURE
    253  * if the time/date string can't be parsed.
    254  *
    255  * Many formats are handled, including:
    256  *
    257  *   14 Apr 89 03:20:12
    258  *   14 Apr 89 03:20 GMT
    259  *   Fri, 17 Mar 89 4:01:33
    260  *   Fri, 17 Mar 89 4:01 GMT
    261  *   Mon Jan 16 16:12 PDT 1989
    262  *   Mon Jan 16 16:12 +0130 1989
    263  *   6 May 1992 16:41-JST (Wednesday)
    264  *   22-AUG-1993 10:59:12.82
    265  *   22-AUG-1993 10:59pm
    266  *   22-AUG-1993 12:59am
    267  *   22-AUG-1993 12:59 PM
    268  *   Friday, August 04, 1995 3:54 PM
    269  *   06/21/95 04:24:34 PM
    270  *   20/06/95 21:07
    271  *   95-06-08 19:32:48 EDT
    272  *
    273  * If the input string doesn't contain a description of the timezone,
    274  * we consult the `default_to_gmt' to decide whether the string should
    275  * be interpreted relative to the local time zone (PR_FALSE) or GMT (PR_TRUE).
    276  * The correct value for this argument depends on what standard specified
    277  * the time string which you are parsing.
    278  */
    279 
    280 NSPR_API(PRStatus) PR_ParseTimeString (
    281         const char *string,
    282         PRBool default_to_gmt,
    283         PRTime *result);
    284 
    285 /*
    286  * FIXME: should we also have a formatting function, such as asctime, ctime,
    287  * and strftime in standard C library?  But this would involve
    288  * internationalization issues.  Might want to provide a US English version.
    289  */
    290 
    291 /**********************************************************************/
    292 /*********************** OLD COMPATIBILITYFUNCTIONS *******************/
    293 /**********************************************************************/
    294 #ifndef NO_NSPR_10_SUPPORT
    295 
    296 /* Format a time value into a buffer. Same semantics as strftime() */
    297 NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
    298                                            const PRExplodedTime *tm);
    299 
    300 /* Format a time value into a buffer. Time is always in US English format, regardless
    301  * of locale setting.
    302  */
    303 NSPR_API(PRUint32)
    304 PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize,
    305                         const char* format, const PRExplodedTime* tm );
    306 
    307 #endif /* NO_NSPR_10_SUPPORT */
    308 
    309227PR_END_EXTERN_C
    310228
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptio.c

    r102063 r102178  
    123123    pr_ContuationStatus status;             /* the status of the operation */
    124124};
    125 
    126 #if defined(DEBUG)
    127 
    128 PTDebug pt_debug;  /* this is shared between several modules */
    129 
    130 PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc *debug_out, const char *msg)
    131 {
    132     PTDebug stats;
    133     char buffer[100];
    134     PRExplodedTime tod;
    135     PRInt64 elapsed, aMil;
    136     stats = pt_debug;  /* a copy */
    137     PR_ExplodeTime(stats.timeStarted, PR_LocalTimeParameters, &tod);
    138     (void)PR_FormatTime(buffer, sizeof(buffer), "%T", &tod);
    139 
    140     LL_SUB(elapsed, PR_Now(), stats.timeStarted);
    141     LL_I2L(aMil, 1000000);
    142     LL_DIV(elapsed, elapsed, aMil);
    143 
    144     if (NULL != msg) PR_fprintf(debug_out, "%s", msg);
    145     PR_fprintf(
    146         debug_out, "\tstarted: %s[%lld]\n", buffer, elapsed);
    147     PR_fprintf(
    148         debug_out, "\tlocks [created: %u, destroyed: %u]\n",
    149         stats.locks_created, stats.locks_destroyed);
    150     PR_fprintf(
    151         debug_out, "\tlocks [acquired: %u, released: %u]\n",
    152         stats.locks_acquired, stats.locks_released);
    153     PR_fprintf(
    154         debug_out, "\tcvars [created: %u, destroyed: %u]\n",
    155         stats.cvars_created, stats.cvars_destroyed);
    156     PR_fprintf(
    157         debug_out, "\tcvars [notified: %u, delayed_delete: %u]\n",
    158         stats.cvars_notified, stats.delayed_cv_deletes);
    159 }  /* PT_FPrintStats */
    160 
    161 #else
    162 
    163 PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc *debug_out, const char *msg)
    164 {
    165     /* do nothing */
    166 }  /* PT_FPrintStats */
    167 
    168 #endif  /* DEBUG */
    169125
    170126/*
     
    434390void _PR_InitIO(void)
    435391{
    436 #if defined(DEBUG)
    437     memset(&pt_debug, 0, sizeof(PTDebug));
    438     pt_debug.timeStarted = PR_Now();
    439 #endif
    440 
    441392    _pr_rename_lock = PR_NewLock();
    442393    Assert(NULL != _pr_rename_lock);
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c

    r102173 r102178  
    5858static pthread_mutexattr_t _pt_mattr;
    5959static pthread_condattr_t _pt_cvar_attr;
    60 
    61 #if defined(DEBUG)
    62 extern PTDebug pt_debug;  /* this is shared between several modules */
    63 #endif  /* defined(DEBUG) */
    6460
    6561/**************************************************************/
     
    134130                }
    135131            }
    136 #if defined(DEBUG)
    137             pt_debug.cvars_notified += 1;
    138             if (0 > ASMAtomicDecS32(&cv->notify_pending))
    139             {
    140                 pt_debug.delayed_cv_deletes += 1;
    141                 PR_DestroyCondVar(cv);
    142             }
    143 #else  /* defined(DEBUG) */
    144132            if (0 > ASMAtomicDecS32(&cv->notify_pending))
    145133                PR_DestroyCondVar(cv);
    146 #endif  /* defined(DEBUG) */
    147134        }
    148135        prev = notified;
     
    165152        Assert(0 == rv);
    166153    }
    167 #if defined(DEBUG)
    168     pt_debug.locks_created += 1;
    169 #endif
    170154    return lock;
    171155}  /* PR_NewLock */
     
    182166#if defined(DEBUG)
    183167    memset(lock, 0xaf, sizeof(PRLock));
    184     pt_debug.locks_destroyed += 1;
    185168#endif
    186169    PR_DELETE(lock);
     
    198181    lock->locked = PR_TRUE;
    199182    lock->owner = pthread_self();
    200 #if defined(DEBUG)
    201     pt_debug.locks_acquired += 1;
    202 #endif
    203183}  /* PR_Lock */
    204184
     
    223203    else pt_PostNotifies(lock, PR_TRUE);
    224204
    225 #if defined(DEBUG)
    226     pt_debug.locks_released += 1;
    227 #endif
    228205    return PR_SUCCESS;
    229206}  /* PR_Unlock */
     
    329306        cv->lock = lock;
    330307        cv->notify_pending = 0;
    331 #if defined(DEBUG)
    332         pt_debug.cvars_created += 1;
    333 #endif
    334308    }
    335309    return cv;
     
    341315    {
    342316        PRIntn rv = pthread_cond_destroy(&cvar->cv); Assert(0 == rv);
    343 #if defined(DEBUG)
    344         memset(cvar, 0xaf, sizeof(PRCondVar));
    345         pt_debug.cvars_destroyed += 1;
    346 #endif
    347317        PR_DELETE(cvar);
    348318    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette